mirror of
https://github.com/ArthurDanjou/arthome.git
synced 2026-01-14 12:14:33 +01:00
18 lines
402 B
TypeScript
18 lines
402 B
TypeScript
import { integer } from 'drizzle-orm/sqlite-core'
|
|
|
|
export const id = integer('id').primaryKey()
|
|
|
|
export const createdAt
|
|
= integer('created_at', { mode: 'timestamp' })
|
|
.$defaultFn(() => new Date())
|
|
|
|
export const updatedAt
|
|
= integer('updated_at', { mode: 'timestamp' })
|
|
.$onUpdateFn(() => new Date())
|
|
.$defaultFn(() => new Date())
|
|
|
|
export const timestamps = {
|
|
createdAt,
|
|
updatedAt,
|
|
}
|