mirror of
https://github.com/withastro/astro.git
synced 2025-01-06 22:10:10 -05:00
21 lines
390 B
TypeScript
21 lines
390 B
TypeScript
import { column, defineDb, defineTable } from "astro:db";
|
|
|
|
const Comment = defineTable({
|
|
columns: {
|
|
postId: column.text(),
|
|
author: column.text(),
|
|
body: column.text(),
|
|
},
|
|
});
|
|
|
|
const Likes = defineTable({
|
|
columns: {
|
|
postId: column.text(),
|
|
likes: column.number(),
|
|
},
|
|
});
|
|
|
|
// https://astro.build/db/config
|
|
export default defineDb({
|
|
tables: { Comment, Likes },
|
|
});
|