import { sql } from 'drizzle-orm' import { boolean, pgTable, text, timestamp, uuid } from 'drizzle-orm/pg-core' export const todoTable = pgTable('todo', { id: uuid('id').primaryKey().default(sql`uuidv7()`), title: text('title').notNull(), completed: boolean('completed').notNull().default(false), createdAt: timestamp('created_at', { withTimezone: true }) .notNull() .defaultNow(), updatedAt: timestamp('updated_at', { withTimezone: true }) .notNull() .defaultNow() .$onUpdateFn(() => new Date()), })