Files
chaohua_coze/drizzle/schema.ts

20 lines
815 B
TypeScript
Raw Normal View History

import { pgTable, index, serial, varchar, date, timestamp } from "drizzle-orm/pg-core"
import { sql } from "drizzle-orm"
export const signInRecords = pgTable("sign_in_records", {
id: serial().primaryKey().notNull(),
userId: varchar("user_id", { length: 128 }).notNull(),
signDate: date("sign_date").notNull(),
createdAt: timestamp("created_at", { withTimezone: true, mode: 'string' }).defaultNow().notNull(),
}, (table) => [
index("sign_in_records_sign_date_idx").using("btree", table.signDate.asc().nullsLast().op("date_ops")),
index("sign_in_records_user_id_idx").using("btree", table.userId.asc().nullsLast().op("text_ops")),
]);
export const healthCheck = pgTable("health_check", {
id: serial().notNull(),
updatedAt: timestamp("updated_at", { withTimezone: true, mode: 'string' }).defaultNow(),
});