feat(admin) : persist drafts and add constellation conditions
This commit is contained in:
+13
-2
@@ -574,16 +574,27 @@ export const artifactProfiles = guidesSchema.table("artifact_profile", {
|
||||
...timestamps,
|
||||
});
|
||||
|
||||
export const constellationConditions = guidesSchema.table(
|
||||
"constellation_condition",
|
||||
{
|
||||
id: uuid("id").defaultRandom().primaryKey(),
|
||||
guideId: uuid("guide_id").notNull().references(() => guides.id, { onDelete: "cascade" }),
|
||||
note: text("note"),
|
||||
sortOrder: integer("sort_order").default(0).notNull(),
|
||||
},
|
||||
(table) => [index("constellation_condition_order_idx").on(table.guideId, table.sortOrder)],
|
||||
);
|
||||
|
||||
export const constellationRecommendations = guidesSchema.table(
|
||||
"constellation_recommendation",
|
||||
{
|
||||
guideId: uuid("guide_id").notNull().references(() => guides.id, { onDelete: "cascade" }),
|
||||
conditionId: uuid("condition_id").notNull().references(() => constellationConditions.id, { onDelete: "cascade" }),
|
||||
level: integer("level").notNull(),
|
||||
detail: text("detail").notNull(),
|
||||
cumulativePercent: numeric("cumulative_percent", { precision: 8, scale: 2 }).notNull(),
|
||||
isGreat: boolean("is_great").default(false).notNull(),
|
||||
},
|
||||
(table) => [primaryKey({ columns: [table.guideId, table.level] })],
|
||||
(table) => [primaryKey({ columns: [table.conditionId, table.level] })],
|
||||
);
|
||||
|
||||
export const teamCompositions = guidesSchema.table(
|
||||
|
||||
Reference in New Issue
Block a user