add table n stuff
This commit is contained in:
14
db/config.ts
14
db/config.ts
@@ -1,4 +1,16 @@
|
||||
import { defineDb } from 'astro:db';
|
||||
import { defineDb, column, defineTable, NOW } from 'astro:db';
|
||||
|
||||
const Entry = defineTable({
|
||||
columns: {
|
||||
id: column.number({ primaryKey: true }),
|
||||
date: column.date({ default: NOW }),
|
||||
location: column.json(),
|
||||
content: column.json({ default: {} })
|
||||
},
|
||||
indexes: [
|
||||
{ on: ['date', 'content'] }
|
||||
]
|
||||
})
|
||||
|
||||
// https://astro.build/db/config
|
||||
export default defineDb({
|
||||
|
||||
Reference in New Issue
Block a user