update: move the fk column below id
This commit is contained in:
parent
dd712ff061
commit
0c8dbba12c
|
|
@ -1,18 +1,14 @@
|
|||
import { createId } from "@paralleldrive/cuid2";
|
||||
import {
|
||||
pgTable,
|
||||
timestamp,
|
||||
varchar,
|
||||
} from "drizzle-orm/pg-core";
|
||||
import { pgTable, timestamp, varchar } from "drizzle-orm/pg-core";
|
||||
import { aspects } from "./aspects";
|
||||
|
||||
export const subAspects = pgTable("sub_aspects", {
|
||||
id: varchar("id", {length: 50})
|
||||
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" }),
|
||||
aspectId: varchar("aspectId").references(() => aspects.id)
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user