mirror of
https://github.com/ArthurDanjou/arthome.git
synced 2026-01-14 12:14:33 +01:00
14 lines
474 B
TypeScript
14 lines
474 B
TypeScript
import { serial, timestamp } from 'drizzle-orm/pg-core'
|
|
/**
|
|
* A centralized list of standardized Drizzle ORM schema field definitions to prevent duplication errors
|
|
*/
|
|
|
|
export const createdAt = timestamp('created_at', { mode: 'date', precision: 3 }).defaultNow()
|
|
export const updatedAt = timestamp('updated_at', { mode: 'date', precision: 3 }).$onUpdate(() => new Date())
|
|
export const id = serial('id').primaryKey()
|
|
|
|
export const timestamps = {
|
|
createdAt,
|
|
updatedAt,
|
|
}
|