ReactTest/src/db/schema.ts
2025-12-06 20:33:10 +01:00

12 lines
421 B
TypeScript

import { pgTable, uuid, text, boolean, timestamp } from 'drizzle-orm/pg-core'
export const todos = pgTable('todos', {
id: uuid('id').primaryKey().defaultRandom(),
name: text('name').notNull(),
isComplete: boolean().notNull(),
createdAt: timestamp({ withTimezone: true }).defaultNow().notNull(),
updatedAt: timestamp({ withTimezone: true })
.defaultNow()
.notNull()
.$onUpdate(() => new Date()),
})