| 1 | import { defineRelations } from "drizzle-orm"; |
| 2 | import { boolean, pgTable, serial, text, timestamp } from "drizzle-orm/pg-core"; |
| 3 | |
| 4 | export const Todos = pgTable("todos", { |
| 5 | id: serial("id").primaryKey(), |
| 6 | text: text("text").notNull(), |
| 7 | done: boolean("done").notNull().default(false), |
| 8 | createdAt: timestamp("created_at", { withTimezone: true }) |
| 9 | .notNull() |
| 10 | .defaultNow(), |
| 11 | }); |
| 12 | export type TodoRow = typeof Todos.$inferSelect; |
| 13 | |
| 14 | export const relations = defineRelations({ Todos }, () => ({})); |