schema.ts16 lines · main
1import { schema, table, text, timestamp } from '@briven/cli/schema';
2
3export default schema({
4 rooms: table({
5 id: text().primaryKey(),
6 name: text().notNull(),
7 createdAt: timestamp().default('now()').notNull(),
8 }),
9 messages: table({
10 id: text().primaryKey(),
11 roomId: text().notNull(),
12 authorName: text().notNull(),
13 body: text().notNull(),
14 createdAt: timestamp().default('now()').notNull(),
15 }),
16});