import { timestamp, uuid } from 'drizzle-orm/pg-core' import { v7 as uuidv7 } from 'uuid' export const generatedFields = { id: uuid('id') .primaryKey() .$defaultFn(() => uuidv7()), createdAt: timestamp('created_at', { withTimezone: true }).notNull().defaultNow(), updatedAt: timestamp('updated_at', { withTimezone: true }) .notNull() .defaultNow() .$onUpdateFn(() => new Date()), } export const generatedFieldKeys = { id: true, createdAt: true, updatedAt: true } as const