feat(guides) : add selectable target and team conditions
This commit is contained in:
@@ -660,11 +660,26 @@ export const artifactProfiles = guidesSchema.table("artifact_profile", {
|
||||
circlet: jsonb("circlet").$type<string[]>().default([]).notNull(),
|
||||
substats: jsonb("substats").$type<string[]>().default([]).notNull(),
|
||||
targets: jsonb("targets").$type<Array<{ stat: string; value: string }>>().default([]).notNull(),
|
||||
targetConditions: jsonb("target_conditions")
|
||||
.$type<Array<{ note: string | null; rows: Array<{ stat: string; value: string }> }>>()
|
||||
.default([])
|
||||
.notNull(),
|
||||
talents: jsonb("talents").$type<Array<{ type: "NA" | "E" | "Q"; priority: number; level?: string; relationToNext?: "gt" | "gte" | "eq" }>>().default([]).notNull(),
|
||||
note: text("note"),
|
||||
...timestamps,
|
||||
});
|
||||
|
||||
export const teamConditions = guidesSchema.table(
|
||||
"team_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("team_condition_order_idx").on(table.guideId, table.sortOrder)],
|
||||
);
|
||||
|
||||
export const constellationConditions = guidesSchema.table(
|
||||
"constellation_condition",
|
||||
{
|
||||
@@ -693,6 +708,7 @@ export const teamCompositions = guidesSchema.table(
|
||||
{
|
||||
id: uuid("id").defaultRandom().primaryKey(),
|
||||
guideId: uuid("guide_id").notNull().references(() => guides.id, { onDelete: "cascade" }),
|
||||
conditionId: uuid("condition_id").references(() => teamConditions.id, { onDelete: "cascade" }),
|
||||
title: text("title").notNull(),
|
||||
rotationSeconds: numeric("rotation_seconds", { precision: 8, scale: 2 }).notNull(),
|
||||
combo: text("combo").notNull(),
|
||||
|
||||
Reference in New Issue
Block a user