schema.ts 435 B

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