feat : add stygian guide
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
uuid,
|
||||
varchar,
|
||||
} from "drizzle-orm/pg-core";
|
||||
import { sql } from "drizzle-orm";
|
||||
|
||||
import type {
|
||||
CatalogAscensionGroup,
|
||||
@@ -274,6 +275,77 @@ export const catalogArtifacts = catalogSchema.table(
|
||||
],
|
||||
);
|
||||
|
||||
export interface StygianMechanic {
|
||||
name: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
export const stygianSchedules = guidesSchema.table(
|
||||
"stygian_schedule",
|
||||
{
|
||||
scheduleId: integer("schedule_id").primaryKey(),
|
||||
challengeName: varchar("challenge_name", { length: 32 }).notNull(),
|
||||
scheduleStartTime: timestamp("schedule_start_time", { withTimezone: true }).notNull(),
|
||||
scheduleEndTime: timestamp("schedule_end_time", { withTimezone: true }).notNull(),
|
||||
version: integer("version").default(1).notNull(),
|
||||
isActive: boolean("is_active").default(false).notNull(),
|
||||
activatedAt: timestamp("activated_at", { withTimezone: true }),
|
||||
...timestamps,
|
||||
},
|
||||
(table) => [
|
||||
index("stygian_schedule_active_idx").on(table.isActive),
|
||||
uniqueIndex("stygian_schedule_single_active_idx").on(table.isActive).where(sql`${table.isActive} = true`),
|
||||
],
|
||||
);
|
||||
|
||||
export const stygianBosses = guidesSchema.table(
|
||||
"stygian_boss",
|
||||
{
|
||||
scheduleId: integer("schedule_id").notNull().references(() => stygianSchedules.scheduleId, { onDelete: "cascade" }),
|
||||
level: integer("level").notNull(),
|
||||
position: integer("position").notNull(),
|
||||
configId: integer("config_id").notNull(),
|
||||
name: text("name").notNull(),
|
||||
hp: numeric("hp", { precision: 18, scale: 2 }).notNull(),
|
||||
description: text("description").notNull(),
|
||||
mechanics: jsonb("mechanics").$type<StygianMechanic[]>().default([]).notNull(),
|
||||
imageKey: text("image_key").notNull(),
|
||||
},
|
||||
(table) => [
|
||||
primaryKey({ columns: [table.scheduleId, table.level, table.position] }),
|
||||
index("stygian_boss_schedule_idx").on(table.scheduleId, table.level),
|
||||
],
|
||||
);
|
||||
|
||||
export const stygianRecommendationGroups = guidesSchema.table(
|
||||
"stygian_recommendation_group",
|
||||
{
|
||||
id: uuid("id").defaultRandom().primaryKey(),
|
||||
scheduleId: integer("schedule_id").notNull().references(() => stygianSchedules.scheduleId, { onDelete: "cascade" }),
|
||||
level: integer("level").notNull(),
|
||||
bossPosition: integer("boss_position").notNull(),
|
||||
kind: varchar("kind", { length: 16 }).notNull(),
|
||||
sortOrder: integer("sort_order").default(0).notNull(),
|
||||
},
|
||||
(table) => [index("stygian_recommendation_group_order_idx").on(table.scheduleId, table.level, table.bossPosition, table.kind, table.sortOrder)],
|
||||
);
|
||||
|
||||
export const stygianRecommendationItems = guidesSchema.table(
|
||||
"stygian_recommendation_item",
|
||||
{
|
||||
groupId: uuid("group_id").notNull().references(() => stygianRecommendationGroups.id, { onDelete: "cascade" }),
|
||||
position: integer("position").notNull(),
|
||||
kind: varchar("kind", { length: 24 }).notNull(),
|
||||
catalogKey: varchar("catalog_key", { length: 64 }),
|
||||
weaponKey: varchar("weapon_key", { length: 64 }),
|
||||
artifactKey: varchar("artifact_key", { length: 64 }),
|
||||
characterKey: varchar("character_key", { length: 64 }),
|
||||
constellationLevel: integer("constellation_level"),
|
||||
element: varchar("element", { length: 24 }),
|
||||
},
|
||||
(table) => [primaryKey({ columns: [table.groupId, table.position] })],
|
||||
);
|
||||
|
||||
export const glossaryAliases = guidesSchema.table(
|
||||
"glossary_alias",
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user