mirror of
https://github.com/BradNut/TofuStack
synced 2025-09-08 17:40:26 +00:00
30 lines
561 B
TypeScript
30 lines
561 B
TypeScript
|
|
import { timestamp } from 'drizzle-orm/pg-core';
|
||
|
|
import { customType } from 'drizzle-orm/pg-core';
|
||
|
|
|
||
|
|
export const citext = customType<{ data: string }>({
|
||
|
|
dataType() {
|
||
|
|
return 'citext';
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
export const cuid2 = customType<{ data: string }>({
|
||
|
|
dataType() {
|
||
|
|
return 'text';
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
export const timestamps = {
|
||
|
|
createdAt: timestamp('created_at', {
|
||
|
|
mode: 'date',
|
||
|
|
withTimezone: true
|
||
|
|
})
|
||
|
|
.notNull()
|
||
|
|
.defaultNow(),
|
||
|
|
updatedAt: timestamp('updated_at', {
|
||
|
|
mode: 'date',
|
||
|
|
withTimezone: true
|
||
|
|
})
|
||
|
|
.notNull()
|
||
|
|
.defaultNow()
|
||
|
|
};
|