This commit is contained in:
2026-01-21 15:00:11 +08:00
parent fd20ca2c52
commit 011c9211f5
62 changed files with 2 additions and 2 deletions

View File

@@ -0,0 +1 @@
export * from './todo'

View File

@@ -0,0 +1,15 @@
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()),
})