import { timestamp } from "drizzle-orm/pg-core";
export const timestamps = {
createdAt: timestamp("created_at", { mode: "date", precision: 3, withTimezone: true })
.defaultNow(),
updatedAt: timestamp("updated_at", { mode: "date", precision: 3, withTimezone: true })
.defaultNow()
.$onUpdateFn(() => new Date())
};
export const projects = pgTable("projects", {
id: serial("id").primaryKey(),
slug: text("slug").notNull().unique(),
displayName: text("display_name").notNull(),
...timestamps
});
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme