mirror of
https://github.com/ArthurDanjou/arthome.git
synced 2026-01-29 10:40:26 +01:00
Working on arthome
This commit is contained in:
20
server/utils/dbFields.ts
Normal file
20
server/utils/dbFields.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import * as pg from 'drizzle-orm/pg-core'
|
||||
|
||||
/**
|
||||
* A centralized list of standardized Drizzle ORM schema field definitions to prevent duplication errors
|
||||
*/
|
||||
|
||||
export const createdAt = pg
|
||||
.timestamp('created_at', { mode: 'date', precision: 3 })
|
||||
.defaultNow()
|
||||
|
||||
export const updatedAt = pg
|
||||
.timestamp('updated_at', { mode: 'date', precision: 3 })
|
||||
.$onUpdate(() => new Date())
|
||||
|
||||
export const id = pg.integer('id').primaryKey({ autoIncrement: true })
|
||||
|
||||
export const timestamps = {
|
||||
createdAt,
|
||||
updatedAt,
|
||||
}
|
||||
Reference in New Issue
Block a user