add table n stuff

This commit is contained in:
2026-01-12 11:50:33 +13:00
parent 8f9733d2b2
commit e448e68c1d
2 changed files with 26 additions and 7 deletions

View File

@@ -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({