15 lines
603 B
TypeScript
15 lines
603 B
TypeScript
import { createId } from "@paralleldrive/cuid2";
|
|
import { pgTable, timestamp, varchar } from "drizzle-orm/pg-core";
|
|
import { aspects } from "./aspects";
|
|
|
|
export const subAspects = pgTable("sub_aspects", {
|
|
id: varchar("id", { length: 50 })
|
|
.primaryKey()
|
|
.$defaultFn(() => createId()),
|
|
aspectId: varchar("aspectId").references(() => aspects.id),
|
|
name: varchar("name", { length: 255 }).notNull(),
|
|
createdAt: timestamp("createdAt", { mode: "date" }).defaultNow(),
|
|
updatedAt: timestamp("updatedAt", { mode: "date" }).defaultNow(),
|
|
deletedAt: timestamp("deletedAt", { mode: "date" }),
|
|
});
|