feat(weapons) : add conditions and unsaved changes warning
This commit is contained in:
+13
-2
@@ -523,11 +523,22 @@ export const guideSections = guidesSchema.table(
|
||||
],
|
||||
);
|
||||
|
||||
export const weaponConditions = guidesSchema.table(
|
||||
"weapon_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("weapon_condition_order_idx").on(table.guideId, table.sortOrder)],
|
||||
);
|
||||
|
||||
export const weaponRecommendations = guidesSchema.table(
|
||||
"weapon_recommendation",
|
||||
{
|
||||
id: uuid("id").defaultRandom().primaryKey(),
|
||||
guideId: uuid("guide_id").notNull().references(() => guides.id, { onDelete: "cascade" }),
|
||||
conditionId: uuid("condition_id").notNull().references(() => weaponConditions.id, { onDelete: "cascade" }),
|
||||
weaponKey: varchar("weapon_key", { length: 64 }).notNull(),
|
||||
refinement: integer("refinement").notNull(),
|
||||
overallPercent: numeric("overall_percent", { precision: 8, scale: 2 }),
|
||||
@@ -535,7 +546,7 @@ export const weaponRecommendations = guidesSchema.table(
|
||||
note: text("note"),
|
||||
sortOrder: integer("sort_order").default(0).notNull(),
|
||||
},
|
||||
(table) => [index("weapon_recommendation_order_idx").on(table.guideId, table.sortOrder)],
|
||||
(table) => [index("weapon_recommendation_order_idx").on(table.conditionId, table.sortOrder)],
|
||||
);
|
||||
|
||||
export const artifactGroups = guidesSchema.table(
|
||||
|
||||
Reference in New Issue
Block a user