feat : add import from buzz guide
CI / verify (push) Successful in 59s
CI / build-and-deploy (push) Successful in 1m38s

This commit is contained in:
2026-09-20 00:41:02 +07:00 Unverified
parent 3fe17a2ff7
commit b3bc4c3bb4
7 changed files with 1406 additions and 81 deletions
+39 -1
View File
@@ -1,7 +1,8 @@
import { integer, jsonb, pgSchema, text, varchar } from "drizzle-orm/pg-core";
import { boolean, integer, jsonb, numeric, pgSchema, text, timestamp, uuid, varchar } from "drizzle-orm/pg-core";
import type { CatalogBaseStat } from "@/lib/translator/types";
export const catalogSchema = pgSchema("catalog");
export const guidesSchema = pgSchema("guides");
export const catalogCharacters = catalogSchema.table("character", {
key: varchar("key", { length: 64 }).primaryKey(), name: text("name").notNull(), element: varchar("element", { length: 48 }), rarity: integer("rarity"), weaponType: varchar("weapon_type", { length: 64 }), imageKey: text("image_key").notNull(), baseStats: jsonb("base_stats").$type<CatalogBaseStat[]>().default([]).notNull(),
@@ -12,3 +13,40 @@ export const catalogWeapons = catalogSchema.table("weapon", {
export const catalogArtifacts = catalogSchema.table("artifact", {
key: varchar("key", { length: 64 }).primaryKey(), name: text("name").notNull(), rarity: integer("rarity"), imageKey: text("image_key").notNull(),
});
export const guides = guidesSchema.table("guide", {
id: uuid("id").primaryKey(),
characterKey: varchar("character_key", { length: 64 }).notNull(),
name: text("name").notNull(),
sortOrder: integer("sort_order").notNull(),
isPublic: boolean("is_public").notNull(),
trashedAt: timestamp("trashed_at", { withTimezone: true }),
});
export const teamConditions = guidesSchema.table("team_condition", {
id: uuid("id").primaryKey(),
guideId: uuid("guide_id").notNull(),
name: varchar("name", { length: 255 }),
sortOrder: integer("sort_order").notNull(),
});
export const teamCompositions = guidesSchema.table("team_composition", {
id: uuid("id").primaryKey(),
guideId: uuid("guide_id").notNull(),
title: text("title").notNull(),
combo: text("combo").notNull(),
sortOrder: integer("sort_order").notNull(),
conditionId: uuid("condition_id"),
rotationSeconds: numeric("rotation_seconds").notNull(),
});
export const teamMembers = guidesSchema.table("team_member", {
teamId: uuid("team_id").notNull(),
position: integer("position").notNull(),
characterKey: varchar("character_key", { length: 64 }).notNull(),
weaponKey: varchar("weapon_key", { length: 64 }).notNull(),
artifactKey: varchar("artifact_key", { length: 64 }).notNull(),
secondArtifactKey: varchar("second_artifact_key", { length: 64 }),
constellation: integer("constellation").notNull(),
refinement: integer("refinement").notNull(),
});