diff --git a/docs/combat-v6-manual-first-release-plan.md b/docs/combat-v6-manual-first-release-plan.md new file mode 100644 index 00000000..9ff97ecd --- /dev/null +++ b/docs/combat-v6-manual-first-release-plan.md @@ -0,0 +1,328 @@ +# combat-v6 首版功法改造计划 + +> 2026-09-16:根据用户确认的 24 本设计编制。状态:首版代码已实施、本地迁移已执行;表中数值是首轮验证基线,不代表已通过战斗平衡验收。 +> 现行规则见 [境界功法系统](combat-v6-manual-system-design.md)。下文保留实施分解,第 8、9 节记录最终决定和本次证据。 + +## 1. 目标与范围 + +将现有 16 本纯六维功法替换为 24 本有明确意象与构筑取舍的功法。每本由一项随层数增加的六维贡献,以及一个随层数增强的简单机制组成。 + +确认保留: + +- 炼气、筑基、金丹、元婴各一个激活位,更高境界不新增位置;同位只激活一本。 +- 九层培养;三、六层使用同名玉简解锁后续层数;每本独立培养,战外免费切换,受既有战斗与结算占用保护。 +- 学习一本玉简,三层突破两本、六层突破三本(合计六本);修炼成本采用本文末尾已确认的升级消耗修订,不引入品质倍率。 +- 六维只加入战斗/展示投影,不写入永久属性。升层与切换不得免费补满气血、法力。 +- 取消功法 common/rare 稀有度。供给由产出概率、权重、渠道等配置决定,不增加战斗预算。 + +本轮不做:连续行动、连招计数、目标记忆、失败补偿、解封反应、治疗转盾、DOT 跳数强化、内部冷却、额外行动、功法主动技能、五行伤害体系、灵根门槛、战外修为倍率、化神以上新功法位、多套构筑存档。 + +按用户“按照推荐,开始实施”的授权,每槽最多收藏六本,仍只激活一本,无遗忘或退款功能。 + +## 2. 内容与成长基线 + +### 2.1 来源与命名 + +灵感资料为用户提供的《凡人修仙传_功法境界表.xlsx》,工作表「功法表」A2:C54;其中包含五行基础功法泛称及同一功法的分段条目。只取名称、描述和意象,以下数值与效果均为本项目游戏改编,不宣称原著存在这些机制。 + +- 炼气取长春功,另自拟金、木、水、火、土五本入门功法。 +- 筑基来源重点为 A4:C11;金丹来源重点为 A20:C30;元婴来源重点为 A32:C38。 +- 使用项目正式六维名:体魄 vitality、力道 strength、灵力 spirit、根骨 endurance、身法 speed、神识 willpower。 +- 游戏境界统一使用「金丹」,不引入资料中的「结丹」作为第二个境界键。 + +### 2.2 成长公式 + +| 归属境界 | 一层加成 | 后续每层增加 | 九层加成 | +| --- | ---: | ---: | ---: | +| 炼气 | 12 | 2 | 28 | +| 筑基 | 18 | 2 | 34 | +| 金丹 | 24 | 4 | 56 | +| 元婴 | 36 | 4 | 68 | + +四槽九层合计 186 点六维。每本仅一项属性,不为难获取功法增加第二项完整属性。 + +机制一层即开放,每层线性成长:`value(L) = valueAt1 + (valueAt9 - valueAt1) × (L - 1) / 8`。条件阈值固定,突破仅解锁升级上限,不新增第二个机制。 + +配置存数值,比例以 0~1 表示;概率修正与伤害倍率使用不同 effect 类型,避免把「降低 3 个百分点」误写成「乘以 0.97」。展示不反向参与计算。金额/气血/法力只在既有最终结算处取整,不在每层插值时提前截断。概率与面板尺度转换保留所需精度,不能沿用整数面板处理使部分等级升级无效。 + +### 2.3 炼气六本 + +| 功法 | 意象 | 六维 | 机制 | 一/五/九层 | +| --- | --- | --- | --- | --- | +| 长春功 | 生机绵长,温养自身 | 体魄 | 回合末自身气血低于 50%,恢复最大气血的一定比例 | 0.25% / 0.5% / 0.75% | +| 庚金诀(自拟) | 金气锐利,先破敌锋 | 力道 | 对气血高于 70% 的目标,主动直接物理伤害提高 | 1% / 2% / 3% | +| 青木养元诀(自拟) | 木气滋生,扶伤续命 | 神识 | 主动治疗气血低于 50% 的主目标,治疗量提高 | 3% / 6% / 9% | +| 清泉诀(自拟) | 涓流回补,法力不竭 | 灵力 | 回合末自身法力低于 50%,恢复最大法力的一定比例 | 0.25% / 0.5% / 0.75% | +| 赤炎诀(自拟) | 精气充盈,火势方盛 | 灵力 | 自身气血高于 70%,主动直接法术伤害提高 | 1% / 2% / 3% | +| 厚土诀(自拟) | 厚土承压,守势稳固 | 根骨 | 自身处于防御状态,受到的直接物理伤害额外降低 | 3% / 6% / 9% | + +### 2.4 筑基六本 + +| 功法 | 意象 | 六维 | 机制 | 一/五/九层 | +| --- | --- | --- | --- | --- | +| 归元功 | 护体灵甲,稳健防御 | 根骨 | 自身拥有有效护盾,受到的直接物理、法术伤害降低 | 2% / 4% / 6% | +| 幻灵诀 | 幻影扰目,难辨真身 | 身法 | 受到直接物理攻击,该次攻击命中率降低 | 1 / 2 / 3 个百分点 | +| 青元剑诀 | 真元养剑,气盛剑锐 | 力道 | 自身气血高于 70%,主动直接物理伤害提高 | 2% / 3% / 4% | +| 大衍诀 | 壮大神识,分神守心 | 神识 | 受到封印判定,对方封印成功率降低 | 1 / 2 / 3 个百分点 | +| 三转重元功 | 真元压缩,法力精纯 | 灵力 | 自身法力高于 70%,主动直接法术伤害提高 | 2% / 3% / 4% | +| 煞妖诀 | 血煞催身,险中争胜 | 体魄 | 自身气血低于 35%,主动直接伤害提高 | 2% / 3% / 4% | + +### 2.5 金丹六本 + +| 功法 | 意象 | 六维 | 机制 | 一/五/九层 | +| --- | --- | --- | --- | --- | +| 太白剑诀 | 剑气破障,锋芒穿护 | 力道 | 对拥有有效护盾的目标,主动直接物理伤害提高 | 3% / 4.5% / 6% | +| 泰阳诀 | 精纯火力,盛阳外放 | 灵力 | 自身气血高于 70%,主动直接法术伤害提高 | 3% / 4.5% / 6% | +| 玄阴大法 | 阴魂蚀体,阴气乘隙 | 灵力 | 对带 DOT 状态的目标,主动直接法术、普通固定伤害提高 | 3% / 4.5% / 6% | +| 玉丹功 | 玉润丹养,扶危固本 | 神识 | 主动治疗气血低于 50% 的主目标,治疗量提高 | 4% / 8% / 12% | +| 天罗真功 | 儒门正气,护佑危局 | 神识 | 为气血低于 50% 的主目标施加护盾,护盾量提高 | 5% / 10% / 15% | +| 六极真魔功 | 真魔法体,受压显威 | 力道 | 自身气血低于 35%,主动直接物理、法术伤害提高 | 3% / 4.5% / 6% | + +### 2.6 元婴六本 + +| 功法 | 意象 | 六维 | 机制 | 一/五/九层 | +| --- | --- | --- | --- | --- | +| 托天魔功 | 肉身强横,重压不折 | 根骨 | 自身气血低于 50%,受到的直接物理伤害降低 | 3% / 5% / 7% | +| 明王诀 | 法体坚固,受制不溃 | 体魄 | 自身处于可解除封印,受到的直接物理、法术伤害降低 | 4% / 7% / 10% | +| 元磁神光 | 元磁牵制,护持周身 | 灵力 | 自身法力高于 50%,受到的直接法术伤害降低 | 3% / 5% / 7% | +| 浩然正气诀 | 邪扰不侵,正气护神 | 神识 | 自身带 Debuff 减益,受到的直接法术伤害降低 | 4% / 7% / 10% | +| 千浪诀 | 身随浪走,危中脱身 | 身法 | 自身气血低于 50%,直接物理攻击者该次命中率降低 | 2 / 4 / 6 个百分点 | +| 幽杀诀 | 杀意逼迫,追索残敌 | 力道 | 对气血低于 35% 的目标,主动直接伤害提高 | 3% / 4.5% / 6% | + +素女轮回功、真灵变化、采补与战外修炼效率类暂不纳入;高境界功法保留后续内容空间,不拆成同名升级书。 + +## 3. 战斗结算合同 + +这些口径需先写成共享领域测试,再接入全部内容。 + +### 3.1 适用对象与效果来源 + +- 功法只装配到人物,不给灵兽继承属性或被动。 +- 输出增幅作用于人物普攻、宗门主动技能的主目标;按物理、法术、普通固定伤害分别编译。通用伤害钩子默认跳过 Fixed,不能遗漏对普通固伤的显式分支。 +- 不强化器诀、物品、反击、连击式派生追击、HookDerived 伤害、DOT 或宗门派生追伤。宗门原技能明确声明的多段直接攻击属于原行动,不因段数新增触发计数。 +- 普通固定伤害可以强化;按目标气血比例扣血、资源扣除等特殊效果不得强化。实施前盘点效果级来源,不通过解析公式字符串、技能中文名或在 core 中硬编码宗门/功法 ID 判断。 +- 仅 skillId 白名单可能无法区分同一混合技能的不同效果。优先利用已有类型与 origin;不足时由内容编译层声明最小的通用效果分类,并由伤害路径透传,避免误伤其他系统原有修正。 +- 治疗与护盾增幅只作用于宗门主动技能的主目标。排除器诀、物品、被动恢复和功法回合恢复,不因群体目标数量获得多倍功法增益。 +- 受击减伤/闪避是佩戴者的防御能力,可应对敌方人物、灵兽、NPC 的相应直接攻击,包括敌方直接攻击器诀;与己方输出不强化器诀的规则分开。 + +### 3.2 条件与时机 + +- 「低于」「高于」严格使用 `<` 与 `>`,恰好 35%、50%、70% 均不满足对应严格条件。 +- 比例气血以当前气血 / 最大气血判断,不以伤势后的可恢复上限替换分母;法力同理。条件在每一段打击或治疗/护盾计算前读取当前事实。 +- 多段攻击跨阈值后,后续段按新血量判断;不添加行动开始快照。 +- 有效护盾指当前尚有正数吸收量的护盾。归元与太白在吸收前判断,最后一层盾被打破后后续段不再获得护盾条件收益。 +- 玄阴读取目标当前的 Dot 类状态,任意施加者均可;不追踪归属、不延长持续、不改 DOT 本身。同一行动先伤害后挂 DOT 的首段不能倒用新状态。 +- 浩然仅读取 Debuff 类;Dot、Control 不混为一类。 +- 明王读取可解除的封印控制。复用并核对既有解控类别口径,排除宗门休息/反噬、不可驱散状态和禁复活状态;不能简单等同于「所有 Control」。 +- 大衍使用现有封印公式尺度和上下限,不绕过免疫,不给必中状态额外掷骰。幻灵/千浪沿用命中钩子和下限,不把必中攻击改成可以闪避。 +- 保护发生后,防守功法读取实际承伤者;输出仍服从既有主目标身份语义,增加保护重定向专项测试。 + +### 3.3 恢复、叠加与显示 + +- 长春/清泉只在回合末对在场存活人物生效,沿用现有回合结束、DOT、战斗结束顺序,不为回血改变胜负裁定。 +- 恢复基数为相应最大资源,最终恢复受当前缺口约束。长春遵守既有禁止恢复、减疗和伤势上限,不复活,不清伤势;恢复不进入主动治疗强化链。 +- 恢复向下取整,允许低等级小基数时为 0,不私自增加保底 1。展示应准确说明比例;验证时检查低境界实际体感。 +- 伤害、治疗等倍率沿用既有计算链,不新增「功法统一加算并封顶」系统。概率差额按现有公式聚合。 +- 四槽机制输出最大倍率粗估为 `1.03 × 1.04 × 1.06 × 1.06 = 1.20360032`。这不是最终战力上限:六维、命中、抗封、恢复、护盾和其他系统交互必须另计。 +- 不增加功法专属通用触发平台。利用现有战报表达回血/回蓝及最终伤害;条件与本层效果在功法详情可见。额外逐击触发提示不作为首版必做项。 + +## 4. 当前代码事实与最小实现边界 + +| 区域 | 当前事实 | 计划变更 | +| --- | --- | --- | +| `manuals/pack.ts`、`types.ts` | effects 仅支持 1~2 项六维,rarity 为必填 | 改为一项属性成长+一个类型化机制;删除功法 rarity;更新 Zod 和生成的 JSON Schema | +| `manuals/content.ts` | 为每本生成空 effects 的被动 | 编译真实机制,不把全部机制开放为策划任意脚本 | +| `manuals/compiler.ts` | 累加属性,携带被动与 skillLevels | 按层数求机制值,输出 hooks/必要的面板贡献,避免重复应用属性 | +| `projection/compose-character-manuals.ts` | 支持追加技能/面板;面板 add 当前统一 floor | 保留投影顺序;概率尺度贡献必须保留精度;面板与战斗输出一致 | +| `core/when.ts`、`types.ts` | 已有血量、主目标、来源、类型、防御、目标状态条件 | 按需补法力比例、自身/目标护盾、自身状态筛选;只做本清单需要的字段 | +| `core/passives.ts`、`hooks.ts` | 支持修改伤害、治疗、护盾、命中 | 复用;核对固伤显式匹配、来源过滤和必要的效果分类透传 | +| `equipment/special-compiler.ts` | 已有封印概率转换为 sealResist 的范例 | 大衍复用同一规则尺度,不复制一套封印公式、不新增封印失败钩子 | +| `manuals/state.ts`、`shared/manuals/action.ts` | 学习、激活、修炼、解锁的纯规则已存在 | 保持流程;仅按收藏决策改上限或另立替换需求 | +| `items/definitions/manual-jades.ts` | 玉简 ID 自动派生 `jade.${manual.id}` | 新 ID 与旧资产切换绑定处理,不能删旧定义后才处理引用 | +| `rewards/wild-pack.ts` | 自动把所有玉简纳入 manualJades 组,权重读功法包 | 把供给名单/权重放到奖励配置,避免「新增内容即自动投放」 | +| `CombatV6ManualService.ts`、`characterLoadoutRepository.ts` | learned JSONB、槽位表、版本校验与事务 | 默认不改持久结构;保留角色锁、归属、revision、占用和提交后事件 | +| 功法页面与物品 preview | 效果偏六维,页面仍显示常见/珍稀 | 共用效果描述器,展示本层/下层六维与机制;去掉功法稀有度文案 | + +完整模块路径以 `src/shared/engine/combat-v6` 为基准;服务/仓储位于 `src/server/lib/services/combat-v6`、`src/server/lib/repositories`。 + +### 4.1 功法内容格式 + +建议数据包格式升为下一版,结构仅包含稳定身份、境界、意象描述、培养规则引用、单属性成长、单机制定义。机制用有限的 discriminated union 表达:伤害增幅、承伤减免、治疗增幅、护盾增幅、物理命中抵抗、封印抵抗、回合气血恢复、回合法力恢复。 + +各类型只开放需要的条件、类型范围、valueAt1/valueAt9。由编译器落实主目标/来源限制,避免策划漏填后把加成扩散到全场。阈值与效果文字由同一数据生成,意象描述单独保存。数据包不接受任意 JS、自由公式、嵌套条件树或 hook 脚本。 + +没有新增状态的机制不人为生成 StatusDef。若实现证明需要临时状态,才补投影状态表合并及 ID 冲突检查,不能预先搭建新框架。 + +静态内容包格式、战斗内容版本与角色 learned 状态 version 是不同概念,不能为了内容变更一并升级所有持久版本。 + +### 4.2 展示范围 + +- `ManualRoom.tsx`、`ManualRealmSlot.tsx`、`ManualJadePicker.tsx`:已学显示实际层数;修炼显示本层→下层的两部分变化;瓶颈明确仅解锁上限。 +- `presentation/basic.ts` 的 manualAdapter:继续「功法名 / 类型→传承境界→数量 / 所载功法效果 / 玉简描述」,不加重复功法名或第三层标题。 +- 未学习玉简显示一层效果和九层成长终点,不假装玩家已具有满层收益。已学上下文不得把玉简本身当成带层数的实例。 +- 共享描述器放在纯 shared 层,复用于页面、物品、公开构筑及查探。概率文案明确为加减百分点,UI 可采用规范允许的简洁符号表达,不能与相对比例混淆。 +- 不新增 rarity 徽章、品质筛选或难获取配色。不影响其他物品自己的品质体系。 +- 公开构筑只暴露激活功法和层数,不暴露收藏;保持现有布局、操作入口、响应式结构和 GameIcon 规范。 + +## 5. 分阶段实施与完成标准 + +阶段顺序为 A → B → C → D → E → F。B/C 可在纯领域数据夹具中先验证,E 的投放及旧资产切换在第 8 节决策落实前不执行。 + +### A. 冻结合同与引用清单 + +- 固化第 2、3 节内容;整理 24 本新 manualId/玉简 ID 清单。长春可评估保留原 ID,名称相近但境界不同的功法不能复用身份(例如原筑基厚土功与新炼气厚土诀)。 +- 盘点普通固伤、按目标血量比例效果、混合技能、主目标治疗/护盾、可解除封印的现行分类。 +- 梳理定义引用:已学记录、槽位、bag/storage、拍卖、邮件附件、宝库及其他奖励载体。只读盘点,不推断任何环境已为空。 +- 确定收藏、旧资产与首批投放决策;形成可审阅清单,再进入对应写入阶段。 + +完成标准:没有靠技能中文名、模糊「控制」或「固伤」描述才能判断的效果;新旧 ID 引用处理路线明确。 + +### B. 最小战斗能力与代表功法 + +- 在 shared 下为缺少的通用条件先写边界测试,再实现。 +- 用代表功法覆盖能力族:长春/清泉(恢复)、庚金(条件输出)、归元/太白(盾存在)、幻灵/千浪(命中)、大衍(封印尺度)、玄阴(状态+固伤)、玉丹/天罗(治疗与盾)、明王/浩然(自身状态)。 +- 验证普攻主目标、普通固伤与特殊扣血、器诀排除、派生伤害、保护、必中和恢复上限。 + +完成标准:不新增行动历史、专属计数器、core 功法 ID 分支;新增条件有独立确定性测试,现有相关 combat-v6 测试通过。 + +### C. 内容包、编译与角色投影 + +- 接入有限机制 schema、统一层数求值与描述器;移除 rarity。 +- 一次性录入 24 本,检查每境界六本、单属性单机制、范围/层数/引用有效。 +- 更新 schema、导出、纯领域测试;人物展示与真实入场使用同一投影。 +- 培养费用按末尾最新修订;保留玉简消耗、未激活功法可培养和战外切换规则;收藏变更只按已决策方案实施。 + +完成标准:所有功法 1~9 层值正确且单调,未激活不生效,永久六维不变;最高资源变化遵守 condition 规则;概率成长无截断台阶错误。 + +### D. 页面、玉简与公开展示 + +- 接入统一效果说明,去除功法 common/rare 所有展示分支。 +- 学习/升层/突破/切换的实际效果与描述一致,升级预览同时展示属性和机制差值。 +- 按现有物品预览规范检查背包、货架、聊天晒物等复用入口,不重构公共预览布局。 +- 覆盖本人、他人查探、未入宗个人面板与未开放境界位置。 + +完成标准:桌面与 360px 实际浏览器检查通过;无前端/服务端单测;旧 revision、资源不足和战斗占用时无多扣、多发或假成功。 + +### E. 产出配置与资产切换 + +- 供给名单与权重由奖励配置拥有。现有 fixed entries 已能显式配置玉简,可优先复用;不为本轮引入新掉落框架。 +- 删除玩法包中的 rarity 与供给耦合;manualJades 自动展开分支若因此无人使用才删除。更新 reward schema 与对应内容版本。 +- 既有玉简组 3% 总掉率是否维持,由投放清单记录。不要把 24 本全部等权自动投放视为已确认,也不在本轮默认新增地图或商店。 +- 按批准的新旧资产方案切换;必要的数据变更复用正式迁移/事务边界。不在计划阶段清空记录、不借机处理其他遗留系统。 +- 更新相关战斗内容版本。发布前安排旧活动战局正常排空或使用既有维护策略,保证恢复战局不混用两版功法;不清 Redis 战局逃避兼容。 +- 核对历史回放依赖归档内容还是重新投影,确保旧回放可读。迁移回滚要覆盖数据与内容版本,不能只回退代码。 + +完成标准:无未知功法/玉简引用、无错位槽位、无丢失进度/物品;产出与展示无 rarity 概念;未完成旧资产盘点与处置决策不得切换目标环境。 + +### F. 平衡与整体验收 + +- 在 shared 纯引擎测试中准备可重复样本,使用固定种子集合对随机命中/封印效果做比较;不创建独立 benchmark、seed、smoke 或故障注入脚本。 +- 比较三组:无功法、仅功法六维、完整功法。装备、灵兽、宗门、对手、初始资源与行动策略保持可比。 +- 覆盖炼气/筑基/金丹/元婴四阶段;高血物理、高血法术、残血魔道、固伤消耗、治疗护盾、抗控防守等组合。 +- 覆盖短战/长战、单体/群体/多段、带盾/无盾、带 DOT/无 DOT、封印/减益、人物+灵兽和队伍配合。 +- 记录有效伤害、实际治疗、有效吸盾、恢复法力、存活回合、控制命中及胜负分布。比例上界、无效触发和过量治疗不能冒充实际收益。 +- 初始目标是适配组合有感、整体贡献小于完整装备与正常出战灵兽;人物输出平均增幅约 8%~12% 作为观察目标,超过约 15% 的持续收益重点复核。机制瞬时约 20% 并不能豁免六维预算。不同定位不能直接用一个「总战力百分比」验收。 +- 检查低层恢复取整是否长期为零、防守/治疗组合是否形成拖延僵局、某一功法是否成为同位无条件最优。 + +完成标准:提交样本、命令与结果记录;未达目标先调整现有数值,不加复杂触发补丁。同步现行设计、产出说明与收尾清单,再标记完成。 + +## 6. 测试与检查清单 + +### 共享领域自动验证 + +- [ ] 数据包:24 本、四境界各六本、唯一 ID、单属性、单机制、无 rarity、无非法条件组合、引用完整。 +- [ ] 成长:全部 1~9 层;1/5/9 锚点、分数百分点精度、下一层差值;永久属性不变。 +- [ ] 血量/法力:阈值下方、恰好阈值、上方;伤势与满资源;低血多段跨阈值。 +- [ ] 护盾:不存在、零量、存在、最后一层打破、多层盾;归元与太白同场。 +- [ ] 状态:Dot/Debuff/Control 分离;不可驱散、休息、禁复活不冒充可解除封印。 +- [ ] 来源:人物普攻/宗门技能/器诀/灵兽/被动/派生/持续伤害;主目标与次目标。 +- [ ] 固伤:普通固伤得到预期加成,目标血量比例扣血与资源扣除不被放大;混合技能逐效果验证。 +- [ ] 恢复:回合末存活、倒地、禁疗、减疗、伤势、缺口、取整、战斗结束顺序;不触发主动治疗增幅。 +- [ ] 命中/封印:百分点加减、既有上下限、必中、免疫、其他来源同时存在;无额外随机调用。 +- [ ] 治疗/护盾:主目标、群体、过量、器诀排除、功法恢复排除。 +- [ ] 状态变更:学习/培养/切换/瓶颈/旧 revision/未激活/未开放境界;收藏规则按最终决策。 +- [ ] 恢复与重放:相同种子、输入及战局快照得到一致结果,保存恢复不丢条件事实。 +- [ ] 产出:只含显式投放项,权重独立于功法强度,未知/重复奖励拒绝。 + +### 本地流程验收 + +按 [测试规范](testing.md) 复用本地测试账号,完成真实学习、升层、瓶颈、切换、刷新、查探与一场战斗。仅在 local 环境准备测试资源。核对当前资源不因面板变化免费补满,失败请求不扣资源,浏览器多页使用旧版本提交时正确刷新。 + +不在 `src/react-app`、`src/server` 新增 test/spec;不 mock 数据库、API、Redis、SMTP 或其他第三方服务。 + +建议实施检查命令: + +```bash +bun run test src/shared/engine/combat-v6/manuals src/shared/manuals +bun run test src/shared/engine/combat-v6/core src/shared/engine/combat-v6/projection src/shared/engine/combat-v6/rules-daoyou +bun run lint +bun run test +bun run build +git diff --check +``` + +先执行与当前改动对应的聚焦测试;本轮涉及通用条件和投影,最终需要全量 shared 回归。build 已包含 client/server 类型检查。schema 更新使用项目已有 Zod toJSONSchema 方式,不手写与源结构不一致的 schema。 + +## 7. 文档与交付物 + +- 本文:内容、边界、阶段、验收与待决策项。 +- 实施后更新 `combat-v6-manual-system-design.md`:正式替代原 16 本属性版,不删除历史验收事实。 +- 实施后更新 `combat-v6-polish-and-closure-plan.md` 中功法供给/平衡条目,链接实际验收记录。 +- 如果收藏规则、产出或资产方案变更,先更新本文相关决定,避免代码与计划各自解释。 +- 每阶段报告修改文件、执行命令、结果及未验项;没有本地真实流程证据不能标记完整交付。 + +## 8. 已落实的切换决定 + +用户明确要求删除旧定义、删除旧数据、不要兼容代码,并按推荐开始实施。 + +- 每境界收藏上限六本,同位只激活一本。 +- 旧 16 本定义被新 24 本替换;不做 ID 映射、退款或旧状态适配。 +- 迁移 `0049_manual_first_release.sql` 清空旧槽位、learned、库存玉简、拍卖玉简及邮件/兑换码玉简附件。保留状态 revision 并递增,防止旧请求重放;邮件其他附件不受影响。 +- 初次产出沿用现有野外渠道与 3% 组概率,24 本各权重 100,配置由奖励包显式维护。 +- 仅本地数据库已执行迁移。部署其他环境应停止旧版本写入、排空活动战局、执行迁移后切换版本;迁移不可仅靠回退代码还原。 +- 冻结历史回放保留,不是可学习、领取或交易的功法数据;无需旧功法运行时兼容。 + +## 9. 实施验证(2026-09-16) + +- 运行配置为 manual pack v3,野外 contentRevision/poolVersion 同步递增。没有改动原始 Excel。 +- 本地迁移后、发放新验收玉简前:槽位 0;两个状态 learned 均为空;库存、拍卖、邮件、兑换码中的旧玉简引用均为 0。 +- 已执行聚焦功法/奖励/公开构筑测试、全量 shared 测试、lint、TypeScript 及客户端/服务端构建。全量结果:168 个文件通过,1390 项通过;仅原有炼体标签快照失败(src/shared/lib/bodyCultivation/pack.test.ts:20),该目录本次无修改。聚焦机制测试 20 项通过。lint、build、tsc 与 git diff --check 均通过。 +- 本地已有账号“本地道友1”真实页面验收:新玉简学习、首本自动激活、后续收藏不覆盖、六本上限隐藏学习入口、免费切换、刷新保留、长春一升二/二升三、三层玉简解锁、感悟不足禁用修炼。当前气血未因属性增长补满。 +- 学习详情与升级确认同时展示六维、当前/下一层/圆满机制。首屏保持简洁,完整机制放在参悟与物品预览层。 +- 九层成长、六层瓶颈、条件边界、来源/主目标过滤、比例固伤排除、状态分类、回合恢复和封印小数精度由纯共享测试覆盖。 +- 未完成真实四槽跨宗门对战强度矩阵、线上产出周期测算、断线恢复和多页并发验收;这些不标记为通过。尚不能宣称功法相对装备/灵兽的长期平衡已验证。 + +### 浏览器与清理补充 + +桌面和 360px 页面及机制详情已检查,浏览器 error 日志为空。六本收藏、切换和升级结果持久化正常;本次未使用的验收玉简已清理,真实学习培养进度保留。未调整准备性境界、六维或修炼资源。 + +### 基础属性调优 + +根据用户关于基础属性感受不明显的反馈,将炼气/筑基每层提高至 +2,金丹/元婴每层提高至 +4;四槽满层由合计 54 点提高至 108 点。机制数值与培养成本不变,现有层数直接按新配置投影,无需重置进度或执行清库迁移。 + +本次数值调整验证:功法/投影/培养操作/公开构筑/奖励聚焦测试 11 个文件、87 项通过;lint 与 diff 检查通过。仅修改成长配置和对应预期,未重新执行全量测试或浏览器流程。 + +### 入门属性基数 + +根据后续反馈,采用一层初始值+后续每层成长:`valueAt1 + (level - 1) × valuePerLevel`。一层直接获得 12/18/24/36 点,不额外加一次成长;九层分别 28/34/56/68 点。数据包结构升为 v3,valueAt1 必填,不加旧格式兼容。投影、槽位展示、玉简与参悟预览复用同一计算函数;层数、成本及机制不变,不执行清库迁移。此前数值调优记录保留为历史。 + +### 升级消耗修订 + +按用户确认的档位,仅调整后续升级费用。L 为升级前层数(1~8),一层学习和瓶颈解锁仍不扣修为、感悟。 + +| 归属境界 | 单次修为 | 单次感悟 | 九层累计修为 | 九层累计感悟 | +| --- | ---: | ---: | ---: | ---: | +| 炼气 | 40 × L | 2 × (L + 1) | 1,440 | 88 | +| 筑基 | 200 × L | 3 × (L + 1) | 7,200 | 132 | +| 金丹 | 1,000 × L | 4 × (L + 1) | 36,000 | 176 | +| 元婴 | 4,000 × L | 5 × (L + 1) | 144,000 | 220 | + +不调整玉简供给、基础属性、机制、层数和感悟上限。现有进度保留,不追溯补扣费用,不执行数据迁移。页面升级预览和服务端扣费均通过 previewManualAction 读取同一配置。 + +本次费用修订验证:`bun run test` 聚焦功法、培养操作、投影、公开构筑及奖励目录,11 个文件、92 项通过;覆盖四境界总预算、八升九精确余额、资源不足拒绝及高境界补修低境界的费用。`bun run lint`、`bun run build`、`git diff --check` 通过。本次未重复全量测试或浏览器流程。 + +### 玉简消耗修订 + +学习消耗 1 本,三层瓶颈消耗 2 本,六层瓶颈消耗 3 本,单本功法圆满共需 6 本同名玉简。共享数量规则统一驱动预览校验、选择器、确认文案和服务端事务扣减;数量不足拒绝突破,数量恰好耗尽删除库存行,有剩余则保留并递增版本。已有解锁不追补,修为及感悟档位不变。 + +本次玉简修订验证:功法与培养操作聚焦测试 4 个文件、48 项通过;lint、前后端 build、git diff --check 通过。本地道友1真实页面验收三层仅1本时不可选、持有5本突破扣2本剩3本、六层突破扣3本归零并解锁九层;数据库核对该玉简库存行已删除。五次真实升级共扣600修为和40感悟,未增加修为;准备性感悟已恢复原值2,保留实际培养进度,无剩余验收玉简,浏览器 error 日志为空。本轮未重复全量测试。 diff --git a/docs/combat-v6-manual-system-design.md b/docs/combat-v6-manual-system-design.md index 7c5d5f93..5b3db8e5 100644 --- a/docs/combat-v6-manual-system-design.md +++ b/docs/combat-v6-manual-system-design.md @@ -3,17 +3,19 @@ > 2026-09-10:经用户确认,替代 Phase 5A/9F 的本篇、真解和覆盖散功方案。无旧数据迁移或兼容。 > 上位设计:[改造路线图](./combat-v6-mhxy-redesign-roadmap.md)。 +> 2026-09-16:首版 24 本功法已实现。每本六维+单条件机制同步成长,取消稀有度;每位最多收藏六本。具体数值与验证记录见[首版功法改造计划](combat-v6-manual-first-release-plan.md)。 + ## 玩法规则 - 炼气、筑基、金丹、元婴各开放一位,总共四位;更高境界不增加位置。 - 功法有固定境界归属,只能在对应位置激活。效果类型不按境界硬限制,由内容设计体现方向差异。 -- 每个位置最多学习三种功法,每本独立保存层数和已解锁上限,同时只激活一本。暂不支持遗忘或替换;学满后不能继续学习新的功法,同名玉简突破不占额外名额。 +- 每个位置最多学习六种功法,每本独立保存层数和已解锁上限,同时只激活一本。暂不支持遗忘或替换;学满后不能继续学习新的功法,同名玉简突破不占额外名额。 - 学习消耗一本同名玉简,从第一层开始。空位自动激活;已有激活功法时,新学功法保存在收藏中。 - 免费切换,无冷却,不丢失培养进度。沿用现有战斗/结算占用保护,战斗结束后才能操作,下一场生效。 -- 默认九层,三层、六层消耗一本同名玉简突破瓶颈,只解锁后续层数,不直接升级。三本玉简加八次修炼完成一本功法。 +- 默认九层,三层、六层分别消耗两本、三本同名玉简突破瓶颈,只解锁后续层数,不直接升级。六本玉简加八次修炼完成一本功法。 - 升层消耗当前可用修为与道心感悟;修为继续用于境界提升,不能透支或导致境界倒退。功法满层不是角色突破条件。 - 未达到功法对应境界时,可持有和交易玉简,不能学习或培养。 -- 未激活功法允许培养。第一版只有六维固定属性加成,稀有功法可同时提供两项效果,两项从一层同时生效。 +- 未激活功法允许培养。每本提供一项六维属性与一个机制,从一层同时生效,九层内均逐层增强。 ## 策划数据包 @@ -29,15 +31,14 @@ | costsByRealm | 各功法归属境界的逐层成本数组;第一项为一升二,必须覆盖所有后续层 | | id | 稳定功法 ID,同时派生玉简和被动 ID | | realm | 功法位归属 | -| rarity | common/rare,显示用,不强制效果数量 | -| effects | 一至两项不重复的六维属性;valuePerLevel 为每层固定加成 | -| dropWeight | 现有野外玉简组内相对权重,与稀有度独立配置 | +| effects | 一项六维属性;valueAt1 为一层初始加成,valuePerLevel 为后续每升一层的增量 | +| mechanism | 机制类型、单条件、适用伤害种类(如需要)、valueAt1 / valueAt9;九层线性插值 | -当前十六本:每境界三本常见单属性、一本珍稀双属性。炼气/筑基每项每层 +1,金丹/元婴每项每层 +2。四本珍稀全部九层提供六维合计 108 点,是初始调参基线,不代表长期平衡结论。 +当前 24 本,每境界六本。炼气/筑基/金丹/元婴一层分别 +12/18/24/36,后续每层分别 +2/2/4/4,四本激活功法全部九层提供六维合计 186 点。机制包括条件增伤、减伤、治疗/护盾增强、闪避、封印抵抗和回合末恢复,详见首版计划。数值是首轮调参基线,尚非长期平衡结论。 -默认修为逐层费用:炼气 20、筑基 100、金丹 500、元婴 2000,分别乘以当前层数;道心感悟二至九层分别消耗 2 至 9。全本共消耗基础修为费用的 36 倍与 44 感悟。成本按功法归属境界计算,不因角色升境变化。 +修为逐层费用:炼气 40、筑基 200、金丹 1000、元婴 4000,分别乘以当前层数 L(1~8);感悟费用分别为 2/3/4/5 × (L + 1)。单本九层累计修为分别 1,440/7,200/36,000/144,000,累计感悟分别 88/132/176/220。最高单次感悟消耗为 45,不改变 100 点储存上限。成本按功法归属境界计算,不因角色升境变化;旧已完成升级不追溯补扣。 -野外既有玉简组总掉落率保持 3%,常见权重 100、珍稀权重 5;现有池暂覆盖全部十六本,每本珍稀的相对掉率为常见的 1/20。玉简沿用统一库存、堆叠和拍卖交易。暂不新增获取渠道。 +野外既有玉简组总掉落率保持 3%,24 本玉简以 fixed 条目显式配置,初始各权重 100。功法包不再存稀有度或产出权重,产出包独立决定供应。玉简沿用统一库存、堆叠和拍卖交易;暂不新增渠道。 修改内容无需修改 TypeScript;新增效果机制才扩展编译器。Schema 结构源为 ManualPackShape,结构变更后通过 Zod toJSONSchema 更新同目录 schema;重复 ID、重复属性、缺失引用和不完整成本表由运行时细化校验拒绝。 @@ -45,26 +46,26 @@ - 已学进度保存在功法状态的 learned JSONB;激活位置沿用独立槽位表,不创建多套构筑。 - 纯 changeManual 与 previewManualAction 产生确定性状态和费用计划。服务端负责身份、玉简归属、版本、战斗占用及资源事实。 -- 每境界三种上限由共享状态校验与学习规则同时检查,服务端在扣减玉简前执行,不只依赖前端隐藏学习入口。 +- 每境界六种上限由共享状态校验与学习规则同时检查,服务端在扣减玉简前执行,不只依赖前端隐藏学习入口。 - 角色锁、数据库事务与版本比较覆盖扣费、玉简消费、功法进度、激活位置和资源事件;任一步失败整体回滚。 -- 每本激活功法编译一个被动标识和一至两项六维贡献。贡献在装备/宗门/炼体面板计算前加入临时属性,派生值遵循现有 v6 公式,不写入永久六维。 -- 被动身份用于记录来源与层数;属性修正由人物编译器应用一次,不再在战斗开始时重复增加。 +- 每本激活功法编译一个随层数编译的机制被动和一项六维贡献。贡献在装备/宗门/炼体面板计算前加入临时属性,派生值遵循现有 v6 公式,不写入永久六维。 +- 被动负责单条件机制结算并记录来源与层数;属性修正由人物编译器应用一次,不再在战斗开始时重复增加。 - 公开构筑只显示激活功法与层数,不暴露未激活收藏或培养记录。 -- 需要应用迁移 `0043_manual-level-progression.sql`;没有旧功法数据兼容。历史 5A/9F 文档保留为阶段记录,不再作为当前规则。 +- 需要应用迁移 `0049_manual_first_release.sql`:清空旧已学进度、槽位、库存玉简、拍卖与邮件/兑换码中的玉简附件;不映射、不退款、不留旧定义兼容。冻结历史战斗归档保留,自包含快照不作为可用功法资产。切换环境应先停止旧版本写入并排空活动战局,再执行迁移与部署。历史 5A/9F 文档保留为阶段记录,不再作为当前规则。 ## 功法页面(2026-09-11) -- 左侧按角色性别展示透明底盘坐墨像,右侧自上而下固定排列炼气、筑基、金丹、元婴四位。桌面与窄屏均保持左右关系,墨像完整显示,无混合模式或整体透明度修补。 +- 左侧按角色性别展示透明底盘坐墨像,右侧自上而下固定排列炼气、筑基、金丹、元婴四位。桌面保持左右关系,窄屏纵向排列,墨像完整显示,无混合模式或整体透明度修补。 - 未学习时显示空槽,未开放时显示对应境界提示,不铺开全部功法配置。 - 每位仅显示当前激活功法、层数、固定属性贡献和参悟入口。两种以上已学功法显示箭头与圆点,左右触摸滑动或箭头点击直接免费切换;提交期间禁用重复操作,服务端成功后更新显示,失败保留或重新读取权威状态。 -- 未满三种时显示学习入口;学满后隐藏入口,仍可培养或切换。学习确认层明确告知三种上限、暂不支持遗忘或替换。 +- 未满六种时显示学习入口;学满后隐藏入口,仍可培养或切换。学习确认层明确告知六种上限、暂不支持遗忘或替换。 - 学习及瓶颈突破复用公共 InventoryItems/ItemSlot 与 InkDetailDrawer;只提供对应境界可学习玉简或同名突破玉简。玩家明确选中具体玉简后再确认消费,不自动挑选库存。 -- 学习第一本自动激活,第二、第三本保留原激活项。培养成本、层数与属性配置保持现有规则。 +- 学习第一本自动激活,后续各本保留原激活项。培养成本、层数与属性配置保持现有规则。 - 美术生成提示词、透明处理和生产文件见 [功法墨像素材记录](./combat-v6-manual-portrait-assets.md)。 ## 验证 -共享规则测试覆盖境界位、三本玉简九层成长、资源不足、版本冲突、收藏独立进度、免费切换、非法状态、双属性投影、数据包校验与现有掉落权重。服务端和页面采用静态检查及真实本地流程验证,不添加数据库或 API 单元测试。 +共享规则测试覆盖境界位、六本玉简九层成长、资源不足、版本冲突、收藏独立进度、免费切换、非法状态、双属性投影、数据包校验与现有掉落权重。服务端和页面采用静态检查及真实本地流程验证,不添加数据库或 API 单元测试。 ### 本地验收(2026-09-10) diff --git a/docs/combat-v6-polish-and-closure-plan.md b/docs/combat-v6-polish-and-closure-plan.md index 69ca78ce..b342643c 100644 --- a/docs/combat-v6-polish-and-closure-plan.md +++ b/docs/combat-v6-polish-and-closure-plan.md @@ -59,7 +59,7 @@ R08依赖R01~R07及首发范围内的核心场景通过;不能仅靠健康 | G05 P1 待验/待调优 | 六种突破、金丹以上幻境、全境界排名主要有链路证据,强化测试属性不能证明正常难度 | 先确定正式可得装备/功法/修炼/心法样本,再制定目标回合、失败率、恢复消耗与收益范围;比较清心前后心魔、同级和跨档挑战,记录实际结果再调系数 | [10F](combat-v6-phase-10f-breakthrough-plan.md)、[10B](combat-v6-phase-10b-tower-plan.md)、[10C](combat-v6-phase-10c-ranking-plan.md) | | G06 P1 待验/待调优 | 五宗门双流派已实现,器蕴/器诀逐项实战、同队手动AUTO、特殊状态组合未全验 | 覆盖五宗十流派、关键经脉、复活/伤势/护盾/五行/形态和器诀,优先容易叠加或重复计效的组合;纯确定性边界使用shared测试,真实页面验证可选、可用及说明一致 | [宗门设计](combat-v6-sect-skill-meridian-system-design.md)、[9D](combat-v6-phase-9d-forging-plan.md)、[10E](combat-v6-phase-10e-auto-sect-tasks-plan.md) | | G07 P1 待调优 | 炼体0~60级节奏、丹毒、配方/灵果供给没有整体经济验证;心法经脉成本已配置但未整体平衡 | 对照正式来源核算升级所需时间、药力、灵石、修为和感悟;发现不可达或明显失衡再改配置。保留消耗品提升五轨、确定性位阶晋升,不新增直接点修 | [修炼设计§13](combat-v6-training-system-design.md#13-后续平衡项)、[宗门设计§13](combat-v6-sect-skill-meridian-system-design.md#13-后续专项平衡项) | -| G08 P1 待调优 | 新功法四境界位、16本九层已完成;全部玉简暂共用青溪3%组,珍稀权重为常见1/20,没有新渠道 | 评估三本同名玉简与八次修炼的实际养成时间、境界供给和交易价格;先决定分层掉落或兑换是否必要,再扩渠道。只调新版层数和成本,不回到本篇/真解 | [功法设计](combat-v6-manual-system-design.md)、[wild.ts](../src/shared/rewards/wild.ts) | +| G08 P1 待调优 | 新功法四境界位、24本九层、每位收藏六本已实现;六维与单条件机制同步成长;全部玉简暂共用青溪3%组、各权重100,没有稀有度或新渠道 | 评估三本同名玉简与八次修炼的实际养成时间、境界供给和交易价格;先决定分层掉落或兑换是否必要,再扩渠道。按[首版验证记录](combat-v6-manual-first-release-plan.md)继续验证机制收益及其低于装备/灵兽的整体预算 | [功法设计](combat-v6-manual-system-design.md)、[wild.ts](../src/shared/rewards/wild.ts) | | G09 P1 待调优 | 蜃楼物资仍复用凡品固定材料,高境界收益未调;掉落长期经济样本不足 | 联合G02/G05建立野外、秘境、蜃楼、宗门、炼器与NPC回收的产销对照,关注资源通胀与无用途产物;每个开放奖励有实际用途,记录版本与既有快照边界 | [10B](combat-v6-phase-10b-tower-plan.md)、[tower奖励](../src/shared/rewards/tower.ts)、[9E](combat-v6-phase-9e-drops-plan.md) | | G10 P1 待验 | 多人/展示:旧8A曾有真实4v4,后续带宠、观众、慢连接与新协议未完成全矩阵 | 8个独立角色每人1宠、另设观众;混合手动/AUTO、倒地、复活、多备用宠换宠、逃跑、重连与终局;确认公开视图不泄露精确属性,按首发容量测请求与播放积压 | [9A](combat-v6-phase-9a-summoned-beast-plan.md)、[8C](combat-v6-phase-8c-spectator-design.md)、[战斗UI](combat-v6-battle-ui.md) | | G11 P1 部分已验 | 10Z已验证恢复丹具体堆叠消耗、人物MP跨场继承、换宠后两只灵兽实际经验到账、真实战败刷新结算;修正休整旧库存来源和扣药占用冲突 | 继续补灵兽MP实际消耗与死亡本轮回归、全地图高等级、任务消费者并发去重及完整状态/构筑入口互斥矩阵;不把部分入口通过外推全部 | [10Z验收](combat-v6-phase-10z-dungeon-continuity.md)、[10A](combat-v6-phase-10a-dungeon-plan.md#待专项验收) | diff --git a/drizzle/0049_manual_first_release.sql b/drizzle/0049_manual_first_release.sql new file mode 100644 index 00000000..30ad3666 --- /dev/null +++ b/drizzle/0049_manual_first_release.sql @@ -0,0 +1,39 @@ +-- Unreleased manual prototype: discard learned progress and all old jade assets. +-- Run during maintenance before the 24-manual content is made available. +DELETE FROM "wanjiedaoyou_cultivator_manual_slots"; +--> statement-breakpoint +-- Keep the concurrency revision monotonic so a pre-reset request cannot replay. +UPDATE "wanjiedaoyou_cultivator_manual_states" +SET "learned" = '[]'::jsonb, "revision" = "revision" + 1, "updated_at" = now(); +--> statement-breakpoint +DELETE FROM "wanjiedaoyou_inventory_items" +WHERE starts_with("definition_id", 'jade.character_manual.'); +--> statement-breakpoint +DELETE FROM "wanjiedaoyou_auction_listings" +WHERE "item_type" = 'manual_jade' + OR starts_with("item_snapshot" #>> '{item,definitionId}', 'jade.character_manual.'); +--> statement-breakpoint +-- Remove only jade attachments; retain the mail and any unrelated rewards. +UPDATE "wanjiedaoyou_mails" AS m +SET "attachments" = ( + SELECT coalesce(jsonb_agg(a.value ORDER BY a.ordinality), '[]'::jsonb) + FROM jsonb_array_elements(m."attachments") WITH ORDINALITY AS a(value, ordinality) + WHERE NOT coalesce(starts_with(a.value #>> '{inventory,definitionId}', 'jade.character_manual.'), false) +) +WHERE jsonb_typeof(m."attachments") = 'array' + AND EXISTS ( + SELECT 1 FROM jsonb_array_elements(m."attachments") AS a(value) + WHERE starts_with(a.value #>> '{inventory,definitionId}', 'jade.character_manual.') + ); +--> statement-breakpoint +UPDATE "wanjiedaoyou_redeem_codes" AS r +SET "reward_attachments" = ( + SELECT coalesce(jsonb_agg(a.value ORDER BY a.ordinality), '[]'::jsonb) + FROM jsonb_array_elements(r."reward_attachments") WITH ORDINALITY AS a(value, ordinality) + WHERE NOT coalesce(starts_with(a.value #>> '{inventory,definitionId}', 'jade.character_manual.'), false) +) +WHERE jsonb_typeof(r."reward_attachments") = 'array' + AND EXISTS ( + SELECT 1 FROM jsonb_array_elements(r."reward_attachments") AS a(value) + WHERE starts_with(a.value #>> '{inventory,definitionId}', 'jade.character_manual.') + ); diff --git a/drizzle/meta/0049_snapshot.json b/drizzle/meta/0049_snapshot.json new file mode 100644 index 00000000..6abb68b0 --- /dev/null +++ b/drizzle/meta/0049_snapshot.json @@ -0,0 +1,8420 @@ +{ + "id": "3152364d-bd3b-413e-ac05-a52649c16947", + "prevId": "e6bcb39c-d795-43d8-93fd-959dc92996d3", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.wanjiedaoyou_account_deletion_records": { + "name": "wanjiedaoyou_account_deletion_records", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "cultivator_ids": { + "name": "cultivator_ids", + "type": "uuid[]", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "requested_at": { + "name": "requested_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "completed_at": { + "name": "completed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "account_deletion_records_user_uidx": { + "name": "account_deletion_records_user_uidx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + }, + "account_deletion_records_status_requested_idx": { + "name": "account_deletion_records_status_requested_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "requested_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_admin_message_templates": { + "name": "wanjiedaoyou_admin_message_templates", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "channel": { + "name": "channel", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(120)", + "primaryKey": false, + "notNull": true + }, + "subject_template": { + "name": "subject_template", + "type": "varchar(300)", + "primaryKey": false, + "notNull": false + }, + "content_template": { + "name": "content_template", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "default_payload": { + "name": "default_payload", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "status": { + "name": "status", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true, + "default": "'active'" + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_by": { + "name": "updated_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "admin_templates_channel_status_created_idx": { + "name": "admin_templates_channel_status_created_idx", + "columns": [ + { + "expression": "channel", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_alchemy_formulas": { + "name": "wanjiedaoyou_alchemy_formulas", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "cultivator_id": { + "name": "cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(100)", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "family": { + "name": "family", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true + }, + "pattern": { + "name": "pattern", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "blueprint": { + "name": "blueprint", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "mastery": { + "name": "mastery", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{\"level\":0,\"exp\":0}'::jsonb" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "alchemy_formulas_cultivator_updated_idx": { + "name": "alchemy_formulas_cultivator_updated_idx", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "alchemy_formulas_cultivator_family_idx": { + "name": "alchemy_formulas_cultivator_family_idx", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "family", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_alchemy_formulas_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_alchemy_formulas_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_alchemy_formulas", + "columnsFrom": [ + "cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_app_settings": { + "name": "wanjiedaoyou_app_settings", + "schema": "", + "columns": { + "key": { + "name": "key", + "type": "varchar(128)", + "primaryKey": true, + "notNull": true + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_by": { + "name": "updated_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_auction_listings": { + "name": "wanjiedaoyou_auction_listings", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "seller_id": { + "name": "seller_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "seller_name": { + "name": "seller_name", + "type": "varchar(100)", + "primaryKey": false, + "notNull": true + }, + "item_type": { + "name": "item_type", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true + }, + "item_id": { + "name": "item_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "item_name": { + "name": "item_name", + "type": "varchar(200)", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "item_quality": { + "name": "item_quality", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "item_category": { + "name": "item_category", + "type": "varchar(50)", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "item_snapshot": { + "name": "item_snapshot", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "price": { + "name": "price", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "initial_quantity": { + "name": "initial_quantity", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "remaining_quantity": { + "name": "remaining_quantity", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "status": { + "name": "status", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true, + "default": "'active'" + }, + "visibility": { + "name": "visibility", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true, + "default": "'public'" + }, + "target_cultivator_id": { + "name": "target_cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "target_cultivator_name": { + "name": "target_cultivator_name", + "type": "varchar(100)", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "sold_at": { + "name": "sold_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "auction_status_expires_created_idx": { + "name": "auction_status_expires_created_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "auction_seller_status_idx": { + "name": "auction_seller_status_idx", + "columns": [ + { + "expression": "seller_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "auction_status_expires_price_idx": { + "name": "auction_status_expires_price_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "price", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "auction_status_type_expires_created_idx": { + "name": "auction_status_type_expires_created_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "item_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "auction_status_expires_item_type_idx": { + "name": "auction_status_expires_item_type_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "item_type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "auction_status_type_category_expires_created_idx": { + "name": "auction_status_type_category_expires_created_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "item_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "item_category", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "auction_status_type_quality_expires_created_idx": { + "name": "auction_status_type_quality_expires_created_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "item_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "item_quality", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "auction_status_item_name_expires_created_idx": { + "name": "auction_status_item_name_expires_created_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "item_name", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "auction_status_seller_name_expires_created_idx": { + "name": "auction_status_seller_name_expires_created_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "seller_name", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "auction_visibility_target_status_idx": { + "name": "auction_visibility_target_status_idx", + "columns": [ + { + "expression": "visibility", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "target_cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_auction_listings_seller_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_auction_listings_seller_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_auction_listings", + "columnsFrom": [ + "seller_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "wanjiedaoyou_auction_listings_target_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_auction_listings_target_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_auction_listings", + "columnsFrom": [ + "target_cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_battle_records_v3": { + "name": "wanjiedaoyou_battle_records_v3", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "cultivator_id": { + "name": "cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "opponent_cultivator_id": { + "name": "opponent_cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "battle_type": { + "name": "battle_type", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true, + "default": "'normal'" + }, + "battle_result": { + "name": "battle_result", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "share_code": { + "name": "share_code", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "shared_at": { + "name": "shared_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "battle_records_v3_cultivator_created_idx": { + "name": "battle_records_v3_cultivator_created_idx", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "battle_records_v3_opponent_created_idx": { + "name": "battle_records_v3_opponent_created_idx", + "columns": [ + { + "expression": "opponent_cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "battle_records_v3_user_created_idx": { + "name": "battle_records_v3_user_created_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "battle_records_v3_share_code_uidx": { + "name": "battle_records_v3_share_code_uidx", + "columns": [ + { + "expression": "share_code", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_battle_records_v3_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_battle_records_v3_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_battle_records_v3", + "columnsFrom": [ + "cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "wanjiedaoyou_battle_records_v3_opponent_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_battle_records_v3_opponent_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_battle_records_v3", + "columnsFrom": [ + "opponent_cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_battle_replay_archives": { + "name": "wanjiedaoyou_battle_replay_archives", + "schema": "", + "columns": { + "match_id": { + "name": "match_id", + "type": "varchar(120)", + "primaryKey": true, + "notNull": true + }, + "replay_version": { + "name": "replay_version", + "type": "varchar(40)", + "primaryKey": false, + "notNull": true + }, + "engine_version": { + "name": "engine_version", + "type": "varchar(40)", + "primaryKey": false, + "notNull": true + }, + "ruleset_version": { + "name": "ruleset_version", + "type": "varchar(60)", + "primaryKey": false, + "notNull": true + }, + "started_at": { + "name": "started_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "finished_at": { + "name": "finished_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "outcome": { + "name": "outcome", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "participants": { + "name": "participants", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "replay": { + "name": "replay", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "archived_at": { + "name": "archived_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "battle_replay_archives_finished_idx": { + "name": "battle_replay_archives_finished_idx", + "columns": [ + { + "expression": "finished_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "battle_replay_archives_participants_gin_idx": { + "name": "battle_replay_archives_participants_gin_idx", + "columns": [ + { + "expression": "participants", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "gin", + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_bet_battles": { + "name": "wanjiedaoyou_bet_battles", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "creator_name": { + "name": "creator_name", + "type": "varchar(100)", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "min_realm": { + "name": "min_realm", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true + }, + "max_realm": { + "name": "max_realm", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true + }, + "taunt": { + "name": "taunt", + "type": "varchar(20)", + "primaryKey": false, + "notNull": false + }, + "creator_stake_snapshot": { + "name": "creator_stake_snapshot", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "challenger_stake_snapshot": { + "name": "challenger_stake_snapshot", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "challenger_id": { + "name": "challenger_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "challenger_name": { + "name": "challenger_name", + "type": "varchar(100)", + "primaryKey": false, + "notNull": false + }, + "winner_cultivator_id": { + "name": "winner_cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "battle_record_v3_id": { + "name": "battle_record_v3_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "matched_at": { + "name": "matched_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "settled_at": { + "name": "settled_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "bet_battles_status_expires_idx": { + "name": "bet_battles_status_expires_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "bet_battles_creator_status_idx": { + "name": "bet_battles_creator_status_idx", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "bet_battles_status_created_idx": { + "name": "bet_battles_status_created_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_bet_battles_creator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_bet_battles_creator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_bet_battles", + "columnsFrom": [ + "creator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "wanjiedaoyou_bet_battles_challenger_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_bet_battles_challenger_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_bet_battles", + "columnsFrom": [ + "challenger_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + }, + "wanjiedaoyou_bet_battles_winner_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_bet_battles_winner_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_bet_battles", + "columnsFrom": [ + "winner_cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + }, + "wanjiedaoyou_bet_battles_battle_record_v3_id_wanjiedaoyou_battle_records_v3_id_fk": { + "name": "wanjiedaoyou_bet_battles_battle_record_v3_id_wanjiedaoyou_battle_records_v3_id_fk", + "tableFrom": "wanjiedaoyou_bet_battles", + "columnsFrom": [ + "battle_record_v3_id" + ], + "tableTo": "wanjiedaoyou_battle_records_v3", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_breakthrough_history": { + "name": "wanjiedaoyou_breakthrough_history", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "cultivator_id": { + "name": "cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "from_realm": { + "name": "from_realm", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true + }, + "from_stage": { + "name": "from_stage", + "type": "varchar(10)", + "primaryKey": false, + "notNull": true + }, + "to_realm": { + "name": "to_realm", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true + }, + "to_stage": { + "name": "to_stage", + "type": "varchar(10)", + "primaryKey": false, + "notNull": true + }, + "age": { + "name": "age", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "years_spent": { + "name": "years_spent", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "story": { + "name": "story", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "breakthrough_history_cultivator_created_idx": { + "name": "breakthrough_history_cultivator_created_idx", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_breakthrough_history_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_breakthrough_history_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_breakthrough_history", + "columnsFrom": [ + "cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_combat_replay_archives": { + "name": "wanjiedaoyou_combat_replay_archives", + "schema": "", + "columns": { + "battle_id": { + "name": "battle_id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "metadata_version": { + "name": "metadata_version", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "source_type": { + "name": "source_type", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true + }, + "battle_type": { + "name": "battle_type", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true + }, + "idempotency_key": { + "name": "idempotency_key", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "engine_version": { + "name": "engine_version", + "type": "varchar(40)", + "primaryKey": false, + "notNull": true + }, + "ruleset_version": { + "name": "ruleset_version", + "type": "varchar(60)", + "primaryKey": false, + "notNull": true + }, + "started_at": { + "name": "started_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "finished_at": { + "name": "finished_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "outcome": { + "name": "outcome", + "type": "varchar(24)", + "primaryKey": false, + "notNull": true + }, + "replay": { + "name": "replay", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "round_count": { + "name": "round_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "sides": { + "name": "sides", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[[],[]]'::jsonb" + }, + "archived_at": { + "name": "archived_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "combat_replay_source_idempotency_uidx": { + "name": "combat_replay_source_idempotency_uidx", + "columns": [ + { + "expression": "source_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "idempotency_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + }, + "combat_replay_finished_idx": { + "name": "combat_replay_finished_idx", + "columns": [ + { + "expression": "finished_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_combat_replay_participants": { + "name": "wanjiedaoyou_combat_replay_participants", + "schema": "", + "columns": { + "battle_id": { + "name": "battle_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "cultivator_id": { + "name": "cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "side": { + "name": "side", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + } + }, + "indexes": { + "combat_replay_participant_cultivator_idx": { + "name": "combat_replay_participant_cultivator_idx", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "battle_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_combat_replay_participants_battle_id_wanjiedaoyou_combat_replay_archives_battle_id_fk": { + "name": "wanjiedaoyou_combat_replay_participants_battle_id_wanjiedaoyou_combat_replay_archives_battle_id_fk", + "tableFrom": "wanjiedaoyou_combat_replay_participants", + "columnsFrom": [ + "battle_id" + ], + "tableTo": "wanjiedaoyou_combat_replay_archives", + "columnsTo": [ + "battle_id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": { + "wanjiedaoyou_combat_replay_participants_battle_id_cultivator_id_pk": { + "name": "wanjiedaoyou_combat_replay_participants_battle_id_cultivator_id_pk", + "columns": [ + "battle_id", + "cultivator_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_consumables": { + "name": "wanjiedaoyou_consumables", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "cultivator_id": { + "name": "cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(100)", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true + }, + "prompt": { + "name": "prompt", + "type": "varchar(200)", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "quality": { + "name": "quality", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true, + "default": "'凡品'" + }, + "spec": { + "name": "spec", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "stack_key": { + "name": "stack_key", + "type": "varchar(128)", + "primaryKey": false, + "notNull": false + }, + "quantity": { + "name": "quantity", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "score": { + "name": "score", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "consumables_cultivator_idx": { + "name": "consumables_cultivator_idx", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "consumables_cultivator_name_quality_idx": { + "name": "consumables_cultivator_name_quality_idx", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quality", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "consumables_cultivator_stack_key_idx": { + "name": "consumables_cultivator_stack_key_idx", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "stack_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "consumables_cultivator_stack_unique": { + "name": "consumables_cultivator_stack_unique", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quality", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "stack_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "where": "\"wanjiedaoyou_consumables\".\"stack_key\" is not null", + "concurrently": false + }, + "consumables_score_idx": { + "name": "consumables_score_idx", + "columns": [ + { + "expression": "score", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_consumables_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_consumables_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_consumables", + "columnsFrom": [ + "cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_creation_products": { + "name": "wanjiedaoyou_creation_products", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "cultivator_id": { + "name": "cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "product_type": { + "name": "product_type", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(100)", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "element": { + "name": "element", + "type": "varchar(10)", + "primaryKey": false, + "notNull": false + }, + "quality": { + "name": "quality", + "type": "varchar(20)", + "primaryKey": false, + "notNull": false + }, + "slot": { + "name": "slot", + "type": "varchar(20)", + "primaryKey": false, + "notNull": false + }, + "score": { + "name": "score", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "is_equipped": { + "name": "is_equipped", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "product_model": { + "name": "product_model", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "creation_products_cultivator_type_idx": { + "name": "creation_products_cultivator_type_idx", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "product_type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "creation_products_type_score_idx": { + "name": "creation_products_type_score_idx", + "columns": [ + { + "expression": "product_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "score", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "creation_products_equipped_idx": { + "name": "creation_products_equipped_idx", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_equipped", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_creation_products_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_creation_products_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_creation_products", + "columnsFrom": [ + "cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_cultivator_beast_lineups": { + "name": "wanjiedaoyou_cultivator_beast_lineups", + "schema": "", + "columns": { + "cultivator_id": { + "name": "cultivator_id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "lineup": { + "name": "lineup", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "starter_claimed_at": { + "name": "starter_claimed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "wanjiedaoyou_cultivator_beast_lineups_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_cultivator_beast_lineups_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_cultivator_beast_lineups", + "columnsFrom": [ + "cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_cultivator_beasts": { + "name": "wanjiedaoyou_cultivator_beasts", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "cultivator_id": { + "name": "cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "individual": { + "name": "individual", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "cultivator_beasts_owner_idx": { + "name": "cultivator_beasts_owner_idx", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_cultivator_beasts_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_cultivator_beasts_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_cultivator_beasts", + "columnsFrom": [ + "cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_cultivator_equipment_slots": { + "name": "wanjiedaoyou_cultivator_equipment_slots", + "schema": "", + "columns": { + "cultivator_id": { + "name": "cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "slot": { + "name": "slot", + "type": "varchar(32)", + "primaryKey": false, + "notNull": true + }, + "equipment_instance_id": { + "name": "equipment_instance_id", + "type": "varchar(160)", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "cultivator_equipment_instance_unique": { + "name": "cultivator_equipment_instance_unique", + "columns": [ + { + "expression": "equipment_instance_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_cultivator_equipment_slots_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_cultivator_equipment_slots_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_cultivator_equipment_slots", + "columnsFrom": [ + "cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "wanjiedaoyou_cultivator_equipment_slots_cultivator_id_equipment_instance_id_wanjiedaoyou_inventory_items_cultivator_id_id_fk": { + "name": "wanjiedaoyou_cultivator_equipment_slots_cultivator_id_equipment_instance_id_wanjiedaoyou_inventory_items_cultivator_id_id_fk", + "tableFrom": "wanjiedaoyou_cultivator_equipment_slots", + "columnsFrom": [ + "cultivator_id", + "equipment_instance_id" + ], + "tableTo": "wanjiedaoyou_inventory_items", + "columnsTo": [ + "cultivator_id", + "id" + ], + "onUpdate": "no action", + "onDelete": "no action" + } + }, + "compositePrimaryKeys": { + "wanjiedaoyou_cultivator_equipment_slots_cultivator_id_slot_pk": { + "name": "wanjiedaoyou_cultivator_equipment_slots_cultivator_id_slot_pk", + "columns": [ + "cultivator_id", + "slot" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_cultivator_friends": { + "name": "wanjiedaoyou_cultivator_friends", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "cultivator_id": { + "name": "cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "friend_cultivator_id": { + "name": "friend_cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "cultivator_friends_pair_uidx": { + "name": "cultivator_friends_pair_uidx", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "friend_cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + }, + "cultivator_friends_friend_idx": { + "name": "cultivator_friends_friend_idx", + "columns": [ + { + "expression": "friend_cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_cultivator_friends_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_cultivator_friends_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_cultivator_friends", + "columnsFrom": [ + "cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "wanjiedaoyou_cultivator_friends_friend_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_cultivator_friends_friend_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_cultivator_friends", + "columnsFrom": [ + "friend_cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_cultivator_manual_slots": { + "name": "wanjiedaoyou_cultivator_manual_slots", + "schema": "", + "columns": { + "cultivator_id": { + "name": "cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "slot": { + "name": "slot", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "manual_id": { + "name": "manual_id", + "type": "varchar(160)", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "cultivator_manual_unique": { + "name": "cultivator_manual_unique", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "manual_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_cultivator_manual_slots_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_cultivator_manual_slots_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_cultivator_manual_slots", + "columnsFrom": [ + "cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": { + "wanjiedaoyou_cultivator_manual_slots_cultivator_id_slot_pk": { + "name": "wanjiedaoyou_cultivator_manual_slots_cultivator_id_slot_pk", + "columns": [ + "cultivator_id", + "slot" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "cultivator_manual_slot_valid": { + "name": "cultivator_manual_slot_valid", + "value": "\"wanjiedaoyou_cultivator_manual_slots\".\"slot\" BETWEEN 1 AND 4" + } + }, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_cultivator_manual_states": { + "name": "wanjiedaoyou_cultivator_manual_states", + "schema": "", + "columns": { + "cultivator_id": { + "name": "cultivator_id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "revision": { + "name": "revision", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "learned": { + "name": "learned", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "wanjiedaoyou_cultivator_manual_states_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_cultivator_manual_states_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_cultivator_manual_states", + "columnsFrom": [ + "cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "cultivator_manual_revision_valid": { + "name": "cultivator_manual_revision_valid", + "value": "\"wanjiedaoyou_cultivator_manual_states\".\"revision\" >= 0" + } + }, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_cultivator_tasks": { + "name": "wanjiedaoyou_cultivator_tasks", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "cultivator_id": { + "name": "cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "definition_id": { + "name": "definition_id", + "type": "varchar(120)", + "primaryKey": false, + "notNull": true + }, + "category": { + "name": "category", + "type": "varchar(40)", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true, + "default": "'active'" + }, + "current_stage": { + "name": "current_stage", + "type": "varchar(120)", + "primaryKey": false, + "notNull": false + }, + "objectives": { + "name": "objectives", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "metadata": { + "name": "metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "completed_at": { + "name": "completed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "cultivator_tasks_cultivator_status_updated_idx": { + "name": "cultivator_tasks_cultivator_status_updated_idx", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "cultivator_tasks_cultivator_definition_unique": { + "name": "cultivator_tasks_cultivator_definition_unique", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "definition_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_cultivator_tasks_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_cultivator_tasks_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_cultivator_tasks", + "columnsFrom": [ + "cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_cultivators": { + "name": "wanjiedaoyou_cultivators", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(100)", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar(50)", + "primaryKey": false, + "notNull": false + }, + "gender": { + "name": "gender", + "type": "varchar(10)", + "primaryKey": false, + "notNull": false + }, + "origin": { + "name": "origin", + "type": "varchar(100)", + "primaryKey": false, + "notNull": false + }, + "personality": { + "name": "personality", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "background": { + "name": "background", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "prompt": { + "name": "prompt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "player_race": { + "name": "player_race", + "type": "varchar(32)", + "primaryKey": false, + "notNull": true, + "default": "'human'" + }, + "race_narrative": { + "name": "race_narrative", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "realm": { + "name": "realm", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true + }, + "realm_stage": { + "name": "realm_stage", + "type": "varchar(10)", + "primaryKey": false, + "notNull": true + }, + "age": { + "name": "age", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 18 + }, + "lifespan": { + "name": "lifespan", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 100 + }, + "closed_door_years_total": { + "name": "closed_door_years_total", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "status": { + "name": "status", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true, + "default": "'active'" + }, + "died_at": { + "name": "died_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "vitality": { + "name": "vitality", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "strength": { + "name": "strength", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 10 + }, + "spirit": { + "name": "spirit", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "endurance": { + "name": "endurance", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 10 + }, + "speed": { + "name": "speed", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "willpower": { + "name": "willpower", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "unallocated_attribute_points": { + "name": "unallocated_attribute_points", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "spirit_stones": { + "name": "spirit_stones", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "reputation": { + "name": "reputation", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "qi": { + "name": "qi", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 200 + }, + "qi_last_refreshed_at": { + "name": "qi_last_refreshed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "last_yield_at": { + "name": "last_yield_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "last_active_at": { + "name": "last_active_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "balance_notes": { + "name": "balance_notes", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "condition": { + "name": "condition", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "game_settings": { + "name": "game_settings", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "cultivation_progress": { + "name": "cultivation_progress", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'{}'::jsonb" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "cultivators_user_status_updated_idx": { + "name": "cultivators_user_status_updated_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "cultivators_status_created_idx": { + "name": "cultivators_status_created_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "cultivators_name_idx": { + "name": "cultivators_name_idx", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "cultivators_status_spirit_stones_idx": { + "name": "cultivators_status_spirit_stones_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "spirit_stones", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_dungeon_histories": { + "name": "wanjiedaoyou_dungeon_histories", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "cultivator_id": { + "name": "cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "theme": { + "name": "theme", + "type": "varchar(100)", + "primaryKey": false, + "notNull": true + }, + "result": { + "name": "result", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "log": { + "name": "log", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "real_gains": { + "name": "real_gains", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "dungeon_histories_cultivator_created_idx": { + "name": "dungeon_histories_cultivator_created_idx", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_dungeon_histories_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_dungeon_histories_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_dungeon_histories", + "columnsFrom": [ + "cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_dungeon_runs": { + "name": "wanjiedaoyou_dungeon_runs", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "cultivator_id": { + "name": "cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "map_node_id": { + "name": "map_node_id", + "type": "varchar(100)", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "default": "'EXPLORING'" + }, + "current_round": { + "name": "current_round", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "max_rounds": { + "name": "max_rounds", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 5 + }, + "danger_score": { + "name": "danger_score", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 10 + }, + "run_state": { + "name": "run_state", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "cost_ledger": { + "name": "cost_ledger", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "gain_ledger": { + "name": "gain_ledger", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "pending_action": { + "name": "pending_action", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "active_battle_id": { + "name": "active_battle_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "battle_payload": { + "name": "battle_payload", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "version": { + "name": "version", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "ended_at": { + "name": "ended_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "dungeon_runs_cultivator_status_updated_idx": { + "name": "dungeon_runs_cultivator_status_updated_idx", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "dungeon_runs_status_updated_idx": { + "name": "dungeon_runs_status_updated_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_dungeon_runs_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_dungeon_runs_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_dungeon_runs", + "columnsFrom": [ + "cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_feedbacks": { + "name": "wanjiedaoyou_feedbacks", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "cultivator_id": { + "name": "cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "type": { + "name": "type", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "feedback_user_created_at_idx": { + "name": "feedback_user_created_at_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "feedback_status_type_created_at_idx": { + "name": "feedback_status_type_created_at_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_feedbacks_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_feedbacks_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_feedbacks", + "columnsFrom": [ + "cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_inventory_items": { + "name": "wanjiedaoyou_inventory_items", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar(160)", + "primaryKey": true, + "notNull": true + }, + "cultivator_id": { + "name": "cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "location": { + "name": "location", + "type": "varchar(16)", + "primaryKey": false, + "notNull": true + }, + "slot_index": { + "name": "slot_index", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "definition_id": { + "name": "definition_id", + "type": "varchar(160)", + "primaryKey": false, + "notNull": true + }, + "stack_key": { + "name": "stack_key", + "type": "varchar(200)", + "primaryKey": false, + "notNull": false + }, + "quantity": { + "name": "quantity", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "instance_data": { + "name": "instance_data", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "revision": { + "name": "revision", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "inventory_owner_id_unique": { + "name": "inventory_owner_id_unique", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + }, + "inventory_owner_location_idx": { + "name": "inventory_owner_location_idx", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "location", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "inventory_stack_lookup_idx": { + "name": "inventory_stack_lookup_idx", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "location", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "definition_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "stack_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "inventory_bag_slot_unique": { + "name": "inventory_bag_slot_unique", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "slot_index", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "where": "\"wanjiedaoyou_inventory_items\".\"location\" = 'bag'", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_inventory_items_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_inventory_items_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_inventory_items", + "columnsFrom": [ + "cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "inventory_quantity_positive": { + "name": "inventory_quantity_positive", + "value": "\"wanjiedaoyou_inventory_items\".\"quantity\" > 0 AND \"wanjiedaoyou_inventory_items\".\"revision\" >= 0" + }, + "inventory_slot_valid": { + "name": "inventory_slot_valid", + "value": "(\"wanjiedaoyou_inventory_items\".\"location\" = 'bag' AND \"wanjiedaoyou_inventory_items\".\"slot_index\" IS NOT NULL AND \"wanjiedaoyou_inventory_items\".\"slot_index\" >= 0) OR (\"wanjiedaoyou_inventory_items\".\"location\" = 'storage' AND \"wanjiedaoyou_inventory_items\".\"slot_index\" IS NULL) OR (\"wanjiedaoyou_inventory_items\".\"location\" = 'equipped' AND \"wanjiedaoyou_inventory_items\".\"slot_index\" IS NULL AND \"wanjiedaoyou_inventory_items\".\"definition_id\" = 'equipment.v6')" + } + }, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_item_library": { + "name": "wanjiedaoyou_item_library", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "item_id": { + "name": "item_id", + "type": "varchar(120)", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true, + "default": "'published'" + }, + "name": { + "name": "name", + "type": "varchar(100)", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "quality": { + "name": "quality", + "type": "varchar(20)", + "primaryKey": false, + "notNull": false + }, + "element": { + "name": "element", + "type": "varchar(10)", + "primaryKey": false, + "notNull": false + }, + "category": { + "name": "category", + "type": "varchar(40)", + "primaryKey": false, + "notNull": false + }, + "sample_key": { + "name": "sample_key", + "type": "double precision", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "payload": { + "name": "payload", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "editor_config": { + "name": "editor_config", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_by": { + "name": "updated_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "item_library_item_id_unique": { + "name": "item_library_item_id_unique", + "columns": [ + { + "expression": "item_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + }, + "item_library_status_type_idx": { + "name": "item_library_status_type_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "item_library_material_sample_idx": { + "name": "item_library_material_sample_idx", + "columns": [ + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "category", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quality", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "sample_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "item_library_name_idx": { + "name": "item_library_name_idx", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_mails": { + "name": "wanjiedaoyou_mails", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "cultivator_id": { + "name": "cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar(200)", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true, + "default": "'system'" + }, + "attachments": { + "name": "attachments", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "is_read": { + "name": "is_read", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_claimed": { + "name": "is_claimed", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "mails_cultivator_created_idx": { + "name": "mails_cultivator_created_idx", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "mails_cultivator_is_read_created_idx": { + "name": "mails_cultivator_is_read_created_idx", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_read", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_mails_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_mails_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_mails", + "columnsFrom": [ + "cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_materials": { + "name": "wanjiedaoyou_materials", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "cultivator_id": { + "name": "cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(100)", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true + }, + "rank": { + "name": "rank", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true + }, + "element": { + "name": "element", + "type": "varchar(10)", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "details": { + "name": "details", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'{}'::jsonb" + }, + "quantity": { + "name": "quantity", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "materials_cultivator_idx": { + "name": "materials_cultivator_idx", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "materials_cultivator_name_idx": { + "name": "materials_cultivator_name_idx", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "materials_cultivator_name_rank_idx": { + "name": "materials_cultivator_name_rank_idx", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "rank", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_materials_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_materials_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_materials", + "columnsFrom": [ + "cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_message_consumptions": { + "name": "wanjiedaoyou_message_consumptions", + "schema": "", + "columns": { + "consumer_name": { + "name": "consumer_name", + "type": "varchar(96)", + "primaryKey": false, + "notNull": true + }, + "message_id": { + "name": "message_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "message_key": { + "name": "message_key", + "type": "varchar(128)", + "primaryKey": false, + "notNull": true + }, + "processed_at": { + "name": "processed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "message_consumptions_processed_idx": { + "name": "message_consumptions_processed_idx", + "columns": [ + { + "expression": "processed_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "wanjiedaoyou_message_consumptions_consumer_name_message_id_pk": { + "name": "wanjiedaoyou_message_consumptions_consumer_name_message_id_pk", + "columns": [ + "consumer_name", + "message_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_player_mutation_requests": { + "name": "wanjiedaoyou_player_mutation_requests", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "cultivator_id": { + "name": "cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "source": { + "name": "source", + "type": "varchar(96)", + "primaryKey": false, + "notNull": true + }, + "request_id": { + "name": "request_id", + "type": "varchar(128)", + "primaryKey": false, + "notNull": true + }, + "request_fingerprint": { + "name": "request_fingerprint", + "type": "varchar(128)", + "primaryKey": false, + "notNull": true + }, + "result": { + "name": "result", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "player_mutation_requests_scope_unique": { + "name": "player_mutation_requests_scope_unique", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "source", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "request_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + }, + "player_mutation_requests_created_idx": { + "name": "player_mutation_requests_created_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_player_mutation_requests_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_player_mutation_requests_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_player_mutation_requests", + "columnsFrom": [ + "cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_pre_heaven_fates": { + "name": "wanjiedaoyou_pre_heaven_fates", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "cultivator_id": { + "name": "cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(100)", + "primaryKey": false, + "notNull": true + }, + "quality": { + "name": "quality", + "type": "varchar(10)", + "primaryKey": false, + "notNull": false + }, + "details": { + "name": "details", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'{}'::jsonb" + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "pre_heaven_fates_cultivator_idx": { + "name": "pre_heaven_fates_cultivator_idx", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_pre_heaven_fates_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_pre_heaven_fates_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_pre_heaven_fates", + "columnsFrom": [ + "cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_qi_logs": { + "name": "wanjiedaoyou_qi_logs", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "cultivator_id": { + "name": "cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "action": { + "name": "action", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true + }, + "action_instance_id": { + "name": "action_instance_id", + "type": "varchar(128)", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "varchar(32)", + "primaryKey": false, + "notNull": true + }, + "qi_cost": { + "name": "qi_cost", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "qi_gain": { + "name": "qi_gain", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "qi_before": { + "name": "qi_before", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "qi_after": { + "name": "qi_after", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "source": { + "name": "source", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false + }, + "metadata": { + "name": "metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "qi_logs_action_instance_uidx": { + "name": "qi_logs_action_instance_uidx", + "columns": [ + { + "expression": "action_instance_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + }, + "qi_logs_cultivator_created_idx": { + "name": "qi_logs_cultivator_created_idx", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "qi_logs_status_created_idx": { + "name": "qi_logs_status_created_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_qi_logs_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_qi_logs_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_qi_logs", + "columnsFrom": [ + "cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_redeem_code_claims": { + "name": "wanjiedaoyou_redeem_code_claims", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "redeem_code_id": { + "name": "redeem_code_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "cultivator_id": { + "name": "cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "mail_id": { + "name": "mail_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "redeem_code_claims_code_user_unique": { + "name": "redeem_code_claims_code_user_unique", + "columns": [ + { + "expression": "redeem_code_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + }, + "redeem_code_claims_user_idx": { + "name": "redeem_code_claims_user_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "redeem_code_claims_code_idx": { + "name": "redeem_code_claims_code_idx", + "columns": [ + { + "expression": "redeem_code_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_redeem_code_claims_redeem_code_id_wanjiedaoyou_redeem_codes_id_fk": { + "name": "wanjiedaoyou_redeem_code_claims_redeem_code_id_wanjiedaoyou_redeem_codes_id_fk", + "tableFrom": "wanjiedaoyou_redeem_code_claims", + "columnsFrom": [ + "redeem_code_id" + ], + "tableTo": "wanjiedaoyou_redeem_codes", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "wanjiedaoyou_redeem_code_claims_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_redeem_code_claims_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_redeem_code_claims", + "columnsFrom": [ + "cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "wanjiedaoyou_redeem_code_claims_mail_id_wanjiedaoyou_mails_id_fk": { + "name": "wanjiedaoyou_redeem_code_claims_mail_id_wanjiedaoyou_mails_id_fk", + "tableFrom": "wanjiedaoyou_redeem_code_claims", + "columnsFrom": [ + "mail_id" + ], + "tableTo": "wanjiedaoyou_mails", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_redeem_codes": { + "name": "wanjiedaoyou_redeem_codes", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "code": { + "name": "code", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true + }, + "reward_preset_id": { + "name": "reward_preset_id", + "type": "varchar(100)", + "primaryKey": false, + "notNull": true + }, + "reward_attachments": { + "name": "reward_attachments", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "mail_title": { + "name": "mail_title", + "type": "varchar(200)", + "primaryKey": false, + "notNull": true + }, + "mail_content": { + "name": "mail_content", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true, + "default": "'active'" + }, + "total_limit": { + "name": "total_limit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "claimed_count": { + "name": "claimed_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "starts_at": { + "name": "starts_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "ends_at": { + "name": "ends_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_by": { + "name": "updated_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "redeem_codes_code_unique": { + "name": "redeem_codes_code_unique", + "columns": [ + { + "expression": "code", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + }, + "redeem_codes_status_created_idx": { + "name": "redeem_codes_status_created_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "redeem_codes_created_idx": { + "name": "redeem_codes_created_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_reputation_shop_items": { + "name": "wanjiedaoyou_reputation_shop_items", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "item_library_item_id": { + "name": "item_library_item_id", + "type": "varchar(120)", + "primaryKey": false, + "notNull": true + }, + "price": { + "name": "price", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "quantity": { + "name": "quantity", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "per_user_limit": { + "name": "per_user_limit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true, + "default": "'active'" + }, + "sort_order": { + "name": "sort_order", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_by": { + "name": "updated_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "reputation_shop_item_library_item_uidx": { + "name": "reputation_shop_item_library_item_uidx", + "columns": [ + { + "expression": "item_library_item_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + }, + "reputation_shop_status_sort_idx": { + "name": "reputation_shop_status_sort_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "sort_order", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_reputation_shop_items_item_library_item_id_wanjiedaoyou_item_library_item_id_fk": { + "name": "wanjiedaoyou_reputation_shop_items_item_library_item_id_wanjiedaoyou_item_library_item_id_fk", + "tableFrom": "wanjiedaoyou_reputation_shop_items", + "columnsFrom": [ + "item_library_item_id" + ], + "tableTo": "wanjiedaoyou_item_library", + "columnsTo": [ + "item_id" + ], + "onUpdate": "no action", + "onDelete": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_reputation_shop_purchases": { + "name": "wanjiedaoyou_reputation_shop_purchases", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "shop_item_id": { + "name": "shop_item_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "cultivator_id": { + "name": "cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "item_library_item_id": { + "name": "item_library_item_id", + "type": "varchar(120)", + "primaryKey": false, + "notNull": true + }, + "quantity": { + "name": "quantity", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "reputation_cost": { + "name": "reputation_cost", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "purchase_week": { + "name": "purchase_week", + "type": "varchar(10)", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "reputation_shop_purchases_cultivator_item_idx": { + "name": "reputation_shop_purchases_cultivator_item_idx", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "shop_item_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "reputation_shop_purchases_week_idx": { + "name": "reputation_shop_purchases_week_idx", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "shop_item_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "purchase_week", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "reputation_shop_purchases_created_idx": { + "name": "reputation_shop_purchases_created_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_reputation_shop_purchases_shop_item_id_wanjiedaoyou_reputation_shop_items_id_fk": { + "name": "wanjiedaoyou_reputation_shop_purchases_shop_item_id_wanjiedaoyou_reputation_shop_items_id_fk", + "tableFrom": "wanjiedaoyou_reputation_shop_purchases", + "columnsFrom": [ + "shop_item_id" + ], + "tableTo": "wanjiedaoyou_reputation_shop_items", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "wanjiedaoyou_reputation_shop_purchases_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_reputation_shop_purchases_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_reputation_shop_purchases", + "columnsFrom": [ + "cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_resource_events": { + "name": "wanjiedaoyou_resource_events", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "scope_id": { + "name": "scope_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "scope_version": { + "name": "scope_version", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "resource_version": { + "name": "resource_version", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "resource_key": { + "name": "resource_key", + "type": "varchar(96)", + "primaryKey": false, + "notNull": true + }, + "operation": { + "name": "operation", + "type": "varchar(24)", + "primaryKey": false, + "notNull": true + }, + "event_type": { + "name": "event_type", + "type": "varchar(96)", + "primaryKey": false, + "notNull": true + }, + "payload": { + "name": "payload", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "actor_cultivator_id": { + "name": "actor_cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "actor_user_id": { + "name": "actor_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "source": { + "name": "source", + "type": "varchar(96)", + "primaryKey": false, + "notNull": true + }, + "request_id": { + "name": "request_id", + "type": "varchar(128)", + "primaryKey": false, + "notNull": false + }, + "mutation_ordinal": { + "name": "mutation_ordinal", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "resource_events_scope_version_ordinal_unique": { + "name": "resource_events_scope_version_ordinal_unique", + "columns": [ + { + "expression": "scope_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "scope_version", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "mutation_ordinal", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + }, + "resource_events_scope_version_idx": { + "name": "resource_events_scope_version_idx", + "columns": [ + { + "expression": "scope_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "scope_version", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "mutation_ordinal", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "resource_events_replay_idx": { + "name": "resource_events_replay_idx", + "columns": [ + { + "expression": "actor_cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "source", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "request_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "mutation_ordinal", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "resource_events_created_idx": { + "name": "resource_events_created_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_resource_events_scope_id_wanjiedaoyou_resource_scopes_id_fk": { + "name": "wanjiedaoyou_resource_events_scope_id_wanjiedaoyou_resource_scopes_id_fk", + "tableFrom": "wanjiedaoyou_resource_events", + "columnsFrom": [ + "scope_id" + ], + "tableTo": "wanjiedaoyou_resource_scopes", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "wanjiedaoyou_resource_events_actor_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_resource_events_actor_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_resource_events", + "columnsFrom": [ + "actor_cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_resource_scopes": { + "name": "wanjiedaoyou_resource_scopes", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "scope_kind": { + "name": "scope_kind", + "type": "varchar(24)", + "primaryKey": false, + "notNull": true + }, + "scope_key": { + "name": "scope_key", + "type": "varchar(128)", + "primaryKey": false, + "notNull": true + }, + "scope_version": { + "name": "scope_version", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "resource_scopes_kind_key_unique": { + "name": "resource_scopes_kind_key_unique", + "columns": [ + { + "expression": "scope_kind", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "scope_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_resource_versions": { + "name": "wanjiedaoyou_resource_versions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "scope_id": { + "name": "scope_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "resource_key": { + "name": "resource_key", + "type": "varchar(96)", + "primaryKey": false, + "notNull": true + }, + "version": { + "name": "version", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "resource_versions_scope_key_unique": { + "name": "resource_versions_scope_key_unique", + "columns": [ + { + "expression": "scope_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "resource_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + }, + "resource_versions_resource_idx": { + "name": "resource_versions_resource_idx", + "columns": [ + { + "expression": "resource_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_resource_versions_scope_id_wanjiedaoyou_resource_scopes_id_fk": { + "name": "wanjiedaoyou_resource_versions_scope_id_wanjiedaoyou_resource_scopes_id_fk", + "tableFrom": "wanjiedaoyou_resource_versions", + "columnsFrom": [ + "scope_id" + ], + "tableTo": "wanjiedaoyou_resource_scopes", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_retreat_records": { + "name": "wanjiedaoyou_retreat_records", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "cultivator_id": { + "name": "cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "realm": { + "name": "realm", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true + }, + "realm_stage": { + "name": "realm_stage", + "type": "varchar(10)", + "primaryKey": false, + "notNull": true + }, + "years": { + "name": "years", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "success": { + "name": "success", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "chance": { + "name": "chance", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "roll": { + "name": "roll", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "timestamp": { + "name": "timestamp", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "modifiers": { + "name": "modifiers", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "retreat_records_cultivator_timestamp_idx": { + "name": "retreat_records_cultivator_timestamp_idx", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "timestamp", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_retreat_records_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_retreat_records_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_retreat_records", + "columnsFrom": [ + "cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_sect_combat_states": { + "name": "wanjiedaoyou_sect_combat_states", + "schema": "", + "columns": { + "membership_id": { + "name": "membership_id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "revision": { + "name": "revision", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "active_path_id": { + "name": "active_path_id", + "type": "varchar(160)", + "primaryKey": false, + "notNull": false + }, + "meridian_depth": { + "name": "meridian_depth", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "wanjiedaoyou_sect_combat_states_membership_id_wanjiedaoyou_sect_memberships_id_fk": { + "name": "wanjiedaoyou_sect_combat_states_membership_id_wanjiedaoyou_sect_memberships_id_fk", + "tableFrom": "wanjiedaoyou_sect_combat_states", + "columnsFrom": [ + "membership_id" + ], + "tableTo": "wanjiedaoyou_sect_memberships", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "sect_combat_progress_valid": { + "name": "sect_combat_progress_valid", + "value": "\"wanjiedaoyou_sect_combat_states\".\"revision\" >= 0 AND \"wanjiedaoyou_sect_combat_states\".\"meridian_depth\" BETWEEN 0 AND 7" + } + }, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_sect_facilities": { + "name": "wanjiedaoyou_sect_facilities", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "sect_id": { + "name": "sect_id", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true + }, + "facility_key": { + "name": "facility_key", + "type": "varchar(32)", + "primaryKey": false, + "notNull": true + }, + "level": { + "name": "level", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "progress": { + "name": "progress", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "sect_facilities_sect_key_unique": { + "name": "sect_facilities_sect_key_unique", + "columns": [ + { + "expression": "sect_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "facility_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_sect_memberships": { + "name": "wanjiedaoyou_sect_memberships", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "cultivator_id": { + "name": "cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "sect_id": { + "name": "sect_id", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "varchar(16)", + "primaryKey": false, + "notNull": true, + "default": "'prospect'" + }, + "experienced_at": { + "name": "experienced_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "joined_at": { + "name": "joined_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "contribution": { + "name": "contribution", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "lifetime_contribution": { + "name": "lifetime_contribution", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "disciple_rank": { + "name": "disciple_rank", + "type": "varchar(16)", + "primaryKey": false, + "notNull": true, + "default": "'registered'" + }, + "office": { + "name": "office", + "type": "varchar(16)", + "primaryKey": false, + "notNull": true, + "default": "'none'" + }, + "promoted_at": { + "name": "promoted_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "config_version": { + "name": "config_version", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 2 + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "sect_memberships_cultivator_sect_unique": { + "name": "sect_memberships_cultivator_sect_unique", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "sect_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + }, + "sect_memberships_active_cultivator_unique": { + "name": "sect_memberships_active_cultivator_unique", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "where": "\"wanjiedaoyou_sect_memberships\".\"status\" = 'active'", + "concurrently": false + }, + "sect_memberships_sect_status_idx": { + "name": "sect_memberships_sect_status_idx", + "columns": [ + { + "expression": "sect_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_sect_memberships_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_sect_memberships_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_sect_memberships", + "columnsFrom": [ + "cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_sect_meridian_loadouts": { + "name": "wanjiedaoyou_sect_meridian_loadouts", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "membership_id": { + "name": "membership_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "path_id": { + "name": "path_id", + "type": "varchar(160)", + "primaryKey": false, + "notNull": true + }, + "revision": { + "name": "revision", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + } + }, + "indexes": { + "sect_meridian_membership_path_unique": { + "name": "sect_meridian_membership_path_unique", + "columns": [ + { + "expression": "membership_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "path_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_sect_meridian_loadouts_membership_id_wanjiedaoyou_sect_memberships_id_fk": { + "name": "wanjiedaoyou_sect_meridian_loadouts_membership_id_wanjiedaoyou_sect_memberships_id_fk", + "tableFrom": "wanjiedaoyou_sect_meridian_loadouts", + "columnsFrom": [ + "membership_id" + ], + "tableTo": "wanjiedaoyou_sect_memberships", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_sect_meridian_nodes": { + "name": "wanjiedaoyou_sect_meridian_nodes", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "loadout_id": { + "name": "loadout_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "node_id": { + "name": "node_id", + "type": "varchar(160)", + "primaryKey": false, + "notNull": true + }, + "layer": { + "name": "layer", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "sect_meridian_loadout_node_unique": { + "name": "sect_meridian_loadout_node_unique", + "columns": [ + { + "expression": "loadout_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "node_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + }, + "sect_meridian_loadout_layer_unique": { + "name": "sect_meridian_loadout_layer_unique", + "columns": [ + { + "expression": "loadout_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "layer", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_sect_meridian_nodes_loadout_id_wanjiedaoyou_sect_meridian_loadouts_id_fk": { + "name": "wanjiedaoyou_sect_meridian_nodes_loadout_id_wanjiedaoyou_sect_meridian_loadouts_id_fk", + "tableFrom": "wanjiedaoyou_sect_meridian_nodes", + "columnsFrom": [ + "loadout_id" + ], + "tableTo": "wanjiedaoyou_sect_meridian_loadouts", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_sect_method_progress": { + "name": "wanjiedaoyou_sect_method_progress", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "membership_id": { + "name": "membership_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "method_id": { + "name": "method_id", + "type": "varchar(160)", + "primaryKey": false, + "notNull": true + }, + "level": { + "name": "level", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + } + }, + "indexes": { + "sect_method_membership_method_unique": { + "name": "sect_method_membership_method_unique", + "columns": [ + { + "expression": "membership_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "method_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_sect_method_progress_membership_id_wanjiedaoyou_sect_memberships_id_fk": { + "name": "wanjiedaoyou_sect_method_progress_membership_id_wanjiedaoyou_sect_memberships_id_fk", + "tableFrom": "wanjiedaoyou_sect_method_progress", + "columnsFrom": [ + "membership_id" + ], + "tableTo": "wanjiedaoyou_sect_memberships", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_sect_shop_items": { + "name": "wanjiedaoyou_sect_shop_items", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "item_library_item_id": { + "name": "item_library_item_id", + "type": "varchar(120)", + "primaryKey": false, + "notNull": true + }, + "price": { + "name": "price", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "quantity": { + "name": "quantity", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "per_user_limit": { + "name": "per_user_limit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true, + "default": "'active'" + }, + "sort_order": { + "name": "sort_order", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_by": { + "name": "updated_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "sect_shop_item_library_item_uidx": { + "name": "sect_shop_item_library_item_uidx", + "columns": [ + { + "expression": "item_library_item_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + }, + "sect_shop_status_sort_idx": { + "name": "sect_shop_status_sort_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "sort_order", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_sect_shop_items_item_library_item_id_wanjiedaoyou_item_library_item_id_fk": { + "name": "wanjiedaoyou_sect_shop_items_item_library_item_id_wanjiedaoyou_item_library_item_id_fk", + "tableFrom": "wanjiedaoyou_sect_shop_items", + "columnsFrom": [ + "item_library_item_id" + ], + "tableTo": "wanjiedaoyou_item_library", + "columnsTo": [ + "item_id" + ], + "onUpdate": "no action", + "onDelete": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_sect_shop_purchases": { + "name": "wanjiedaoyou_sect_shop_purchases", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "shop_item_id": { + "name": "shop_item_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "cultivator_id": { + "name": "cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "membership_id": { + "name": "membership_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "item_library_item_id": { + "name": "item_library_item_id", + "type": "varchar(120)", + "primaryKey": false, + "notNull": true + }, + "quantity": { + "name": "quantity", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "contribution_cost": { + "name": "contribution_cost", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "purchase_week": { + "name": "purchase_week", + "type": "varchar(10)", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "sect_shop_purchases_cultivator_item_idx": { + "name": "sect_shop_purchases_cultivator_item_idx", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "shop_item_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "sect_shop_purchases_week_idx": { + "name": "sect_shop_purchases_week_idx", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "shop_item_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "purchase_week", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "sect_shop_purchases_created_idx": { + "name": "sect_shop_purchases_created_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_sect_shop_purchases_shop_item_id_wanjiedaoyou_sect_shop_items_id_fk": { + "name": "wanjiedaoyou_sect_shop_purchases_shop_item_id_wanjiedaoyou_sect_shop_items_id_fk", + "tableFrom": "wanjiedaoyou_sect_shop_purchases", + "columnsFrom": [ + "shop_item_id" + ], + "tableTo": "wanjiedaoyou_sect_shop_items", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "wanjiedaoyou_sect_shop_purchases_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_sect_shop_purchases_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_sect_shop_purchases", + "columnsFrom": [ + "cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "wanjiedaoyou_sect_shop_purchases_membership_id_wanjiedaoyou_sect_memberships_id_fk": { + "name": "wanjiedaoyou_sect_shop_purchases_membership_id_wanjiedaoyou_sect_memberships_id_fk", + "tableFrom": "wanjiedaoyou_sect_shop_purchases", + "columnsFrom": [ + "membership_id" + ], + "tableTo": "wanjiedaoyou_sect_memberships", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_sect_stipend_claims": { + "name": "wanjiedaoyou_sect_stipend_claims", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "membership_id": { + "name": "membership_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "week_key": { + "name": "week_key", + "type": "varchar(10)", + "primaryKey": false, + "notNull": true + }, + "spirit_stones": { + "name": "spirit_stones", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "claimed_at": { + "name": "claimed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "sect_stipend_member_week_unique": { + "name": "sect_stipend_member_week_unique", + "columns": [ + { + "expression": "membership_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "week_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + }, + "sect_stipend_claimed_idx": { + "name": "sect_stipend_claimed_idx", + "columns": [ + { + "expression": "claimed_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_sect_stipend_claims_membership_id_wanjiedaoyou_sect_memberships_id_fk": { + "name": "wanjiedaoyou_sect_stipend_claims_membership_id_wanjiedaoyou_sect_memberships_id_fk", + "tableFrom": "wanjiedaoyou_sect_stipend_claims", + "columnsFrom": [ + "membership_id" + ], + "tableTo": "wanjiedaoyou_sect_memberships", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_sect_task_records": { + "name": "wanjiedaoyou_sect_task_records", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "membership_id": { + "name": "membership_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "task_id": { + "name": "task_id", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true + }, + "kind": { + "name": "kind", + "type": "varchar(16)", + "primaryKey": false, + "notNull": true + }, + "period_key": { + "name": "period_key", + "type": "varchar(16)", + "primaryKey": false, + "notNull": true + }, + "attempt": { + "name": "attempt", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "status": { + "name": "status", + "type": "varchar(16)", + "primaryKey": false, + "notNull": true, + "default": "'active'" + }, + "progress": { + "name": "progress", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "payload": { + "name": "payload", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "completed_at": { + "name": "completed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "claimed_at": { + "name": "claimed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "sect_task_membership_period_task_attempt_unique": { + "name": "sect_task_membership_period_task_attempt_unique", + "columns": [ + { + "expression": "membership_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "period_key", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "task_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "attempt", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + }, + "sect_task_membership_kind_period_idx": { + "name": "sect_task_membership_kind_period_idx", + "columns": [ + { + "expression": "membership_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "kind", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "period_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_sect_task_records_membership_id_wanjiedaoyou_sect_memberships_id_fk": { + "name": "wanjiedaoyou_sect_task_records_membership_id_wanjiedaoyou_sect_memberships_id_fk", + "tableFrom": "wanjiedaoyou_sect_task_records", + "columnsFrom": [ + "membership_id" + ], + "tableTo": "wanjiedaoyou_sect_memberships", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_spirit_fields": { + "name": "wanjiedaoyou_spirit_fields", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "cultivator_id": { + "name": "cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "self_harvest_count": { + "name": "self_harvest_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "total_care_count": { + "name": "total_care_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "starter_claimed": { + "name": "starter_claimed", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "plots": { + "name": "plots", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "version": { + "name": "version", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "spirit_fields_cultivator_uidx": { + "name": "spirit_fields_cultivator_uidx", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + }, + "spirit_fields_updated_idx": { + "name": "spirit_fields_updated_idx", + "columns": [ + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_spirit_fields_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_spirit_fields_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_spirit_fields", + "columnsFrom": [ + "cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_spiritual_roots": { + "name": "wanjiedaoyou_spiritual_roots", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "cultivator_id": { + "name": "cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "element": { + "name": "element", + "type": "varchar(10)", + "primaryKey": false, + "notNull": true + }, + "strength": { + "name": "strength", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "marrow_wash_bonus": { + "name": "marrow_wash_bonus", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "grade": { + "name": "grade", + "type": "varchar(20)", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "spiritual_roots_cultivator_idx": { + "name": "spiritual_roots_cultivator_idx", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_spiritual_roots_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_spiritual_roots_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_spiritual_roots", + "columnsFrom": [ + "cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_sponsorship_admin_actions": { + "name": "wanjiedaoyou_sponsorship_admin_actions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "admin_user_id": { + "name": "admin_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "action": { + "name": "action", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true + }, + "order_id": { + "name": "order_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "metadata": { + "name": "metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "sponsorship_admin_actions_admin_created_idx": { + "name": "sponsorship_admin_actions_admin_created_idx", + "columns": [ + { + "expression": "admin_user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "sponsorship_admin_actions_order_created_idx": { + "name": "sponsorship_admin_actions_order_created_idx", + "columns": [ + { + "expression": "order_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_sponsorship_admin_actions_order_id_wanjiedaoyou_sponsorship_orders_id_fk": { + "name": "wanjiedaoyou_sponsorship_admin_actions_order_id_wanjiedaoyou_sponsorship_orders_id_fk", + "tableFrom": "wanjiedaoyou_sponsorship_admin_actions", + "columnsFrom": [ + "order_id" + ], + "tableTo": "wanjiedaoyou_sponsorship_orders", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_sponsorship_checkout_intents": { + "name": "wanjiedaoyou_sponsorship_checkout_intents", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "provider": { + "name": "provider", + "type": "varchar(32)", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "cultivator_id": { + "name": "cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "tier": { + "name": "tier", + "type": "varchar(32)", + "primaryKey": false, + "notNull": true + }, + "expected_plan_id": { + "name": "expected_plan_id", + "type": "varchar(80)", + "primaryKey": false, + "notNull": false + }, + "public_listing": { + "name": "public_listing", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "status": { + "name": "status", + "type": "varchar(24)", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "provider_order_id": { + "name": "provider_order_id", + "type": "varchar(80)", + "primaryKey": false, + "notNull": false + }, + "config_snapshot": { + "name": "config_snapshot", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "sponsorship_checkout_provider_order_uidx": { + "name": "sponsorship_checkout_provider_order_uidx", + "columns": [ + { + "expression": "provider", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "provider_order_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + }, + "sponsorship_checkout_user_created_idx": { + "name": "sponsorship_checkout_user_created_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "sponsorship_checkout_status_expires_idx": { + "name": "sponsorship_checkout_status_expires_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_sponsorship_checkout_intents_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_sponsorship_checkout_intents_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_sponsorship_checkout_intents", + "columnsFrom": [ + "cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_sponsorship_claims": { + "name": "wanjiedaoyou_sponsorship_claims", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "order_id": { + "name": "order_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "code_hash": { + "name": "code_hash", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true + }, + "code": { + "name": "code", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "public_listing": { + "name": "public_listing", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "version": { + "name": "version", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "status": { + "name": "status", + "type": "varchar(24)", + "primaryKey": false, + "notNull": true, + "default": "'active'" + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "cultivator_id": { + "name": "cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "claimed_at": { + "name": "claimed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "message_status": { + "name": "message_status", + "type": "varchar(24)", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "message_attempts": { + "name": "message_attempts", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "last_message_error": { + "name": "last_message_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "sponsorship_claims_order_uidx": { + "name": "sponsorship_claims_order_uidx", + "columns": [ + { + "expression": "order_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + }, + "sponsorship_claims_code_hash_uidx": { + "name": "sponsorship_claims_code_hash_uidx", + "columns": [ + { + "expression": "code_hash", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + }, + "sponsorship_claims_status_expires_idx": { + "name": "sponsorship_claims_status_expires_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_sponsorship_claims_order_id_wanjiedaoyou_sponsorship_orders_id_fk": { + "name": "wanjiedaoyou_sponsorship_claims_order_id_wanjiedaoyou_sponsorship_orders_id_fk", + "tableFrom": "wanjiedaoyou_sponsorship_claims", + "columnsFrom": [ + "order_id" + ], + "tableTo": "wanjiedaoyou_sponsorship_orders", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "wanjiedaoyou_sponsorship_claims_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_sponsorship_claims_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_sponsorship_claims", + "columnsFrom": [ + "cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_sponsorship_merit_profiles": { + "name": "wanjiedaoyou_sponsorship_merit_profiles", + "schema": "", + "columns": { + "cultivator_id": { + "name": "cultivator_id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "is_public": { + "name": "is_public", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "highest_tier": { + "name": "highest_tier", + "type": "varchar(32)", + "primaryKey": false, + "notNull": true + }, + "merit_count": { + "name": "merit_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "first_supported_at": { + "name": "first_supported_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "last_supported_at": { + "name": "last_supported_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "sponsorship_merit_public_tier_first_idx": { + "name": "sponsorship_merit_public_tier_first_idx", + "columns": [ + { + "expression": "is_public", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "highest_tier", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "first_supported_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_sponsorship_merit_profiles_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_sponsorship_merit_profiles_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_sponsorship_merit_profiles", + "columnsFrom": [ + "cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_sponsorship_merit_records": { + "name": "wanjiedaoyou_sponsorship_merit_records", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "order_id": { + "name": "order_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "cultivator_id": { + "name": "cultivator_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "tier": { + "name": "tier", + "type": "varchar(32)", + "primaryKey": false, + "notNull": true + }, + "source": { + "name": "source", + "type": "varchar(32)", + "primaryKey": false, + "notNull": true + }, + "supported_at": { + "name": "supported_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "mail_id": { + "name": "mail_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "revoked_at": { + "name": "revoked_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "sponsorship_merit_order_uidx": { + "name": "sponsorship_merit_order_uidx", + "columns": [ + { + "expression": "order_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + }, + "sponsorship_merit_cultivator_supported_idx": { + "name": "sponsorship_merit_cultivator_supported_idx", + "columns": [ + { + "expression": "cultivator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "supported_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_sponsorship_merit_records_order_id_wanjiedaoyou_sponsorship_orders_id_fk": { + "name": "wanjiedaoyou_sponsorship_merit_records_order_id_wanjiedaoyou_sponsorship_orders_id_fk", + "tableFrom": "wanjiedaoyou_sponsorship_merit_records", + "columnsFrom": [ + "order_id" + ], + "tableTo": "wanjiedaoyou_sponsorship_orders", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + }, + "wanjiedaoyou_sponsorship_merit_records_cultivator_id_wanjiedaoyou_cultivators_id_fk": { + "name": "wanjiedaoyou_sponsorship_merit_records_cultivator_id_wanjiedaoyou_cultivators_id_fk", + "tableFrom": "wanjiedaoyou_sponsorship_merit_records", + "columnsFrom": [ + "cultivator_id" + ], + "tableTo": "wanjiedaoyou_cultivators", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "wanjiedaoyou_sponsorship_merit_records_mail_id_wanjiedaoyou_mails_id_fk": { + "name": "wanjiedaoyou_sponsorship_merit_records_mail_id_wanjiedaoyou_mails_id_fk", + "tableFrom": "wanjiedaoyou_sponsorship_merit_records", + "columnsFrom": [ + "mail_id" + ], + "tableTo": "wanjiedaoyou_mails", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_sponsorship_order_snapshots": { + "name": "wanjiedaoyou_sponsorship_order_snapshots", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "order_id": { + "name": "order_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "source": { + "name": "source", + "type": "varchar(24)", + "primaryKey": false, + "notNull": true + }, + "payload": { + "name": "payload", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "purge_after": { + "name": "purge_after", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "sponsorship_snapshots_order_created_idx": { + "name": "sponsorship_snapshots_order_created_idx", + "columns": [ + { + "expression": "order_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "sponsorship_snapshots_purge_idx": { + "name": "sponsorship_snapshots_purge_idx", + "columns": [ + { + "expression": "purge_after", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_sponsorship_order_snapshots_order_id_wanjiedaoyou_sponsorship_orders_id_fk": { + "name": "wanjiedaoyou_sponsorship_order_snapshots_order_id_wanjiedaoyou_sponsorship_orders_id_fk", + "tableFrom": "wanjiedaoyou_sponsorship_order_snapshots", + "columnsFrom": [ + "order_id" + ], + "tableTo": "wanjiedaoyou_sponsorship_orders", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_sponsorship_orders": { + "name": "wanjiedaoyou_sponsorship_orders", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "provider": { + "name": "provider", + "type": "varchar(32)", + "primaryKey": false, + "notNull": true + }, + "provider_order_id": { + "name": "provider_order_id", + "type": "varchar(80)", + "primaryKey": false, + "notNull": true + }, + "custom_order_id": { + "name": "custom_order_id", + "type": "varchar(128)", + "primaryKey": false, + "notNull": false + }, + "provider_user_id": { + "name": "provider_user_id", + "type": "varchar(80)", + "primaryKey": false, + "notNull": false + }, + "plan_id": { + "name": "plan_id", + "type": "varchar(80)", + "primaryKey": false, + "notNull": false + }, + "sku_id": { + "name": "sku_id", + "type": "varchar(80)", + "primaryKey": false, + "notNull": false + }, + "product_type": { + "name": "product_type", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "total_amount_fen": { + "name": "total_amount_fen", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "show_amount_fen": { + "name": "show_amount_fen", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "month": { + "name": "month", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "provider_status": { + "name": "provider_status", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "provider_created_at": { + "name": "provider_created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "verification_status": { + "name": "verification_status", + "type": "varchar(24)", + "primaryKey": false, + "notNull": true, + "default": "'received'" + }, + "fulfillment_status": { + "name": "fulfillment_status", + "type": "varchar(24)", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "resolved_tier": { + "name": "resolved_tier", + "type": "varchar(32)", + "primaryKey": false, + "notNull": false + }, + "checkout_intent_id": { + "name": "checkout_intent_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "config_snapshot": { + "name": "config_snapshot", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "retry_count": { + "name": "retry_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "last_error_code": { + "name": "last_error_code", + "type": "varchar(80)", + "primaryKey": false, + "notNull": false + }, + "last_error_message": { + "name": "last_error_message", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "signature_verified_at": { + "name": "signature_verified_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "verified_at": { + "name": "verified_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "fulfilled_at": { + "name": "fulfilled_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "revoked_at": { + "name": "revoked_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "sensitive_purged_at": { + "name": "sensitive_purged_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "sponsorship_orders_provider_order_uidx": { + "name": "sponsorship_orders_provider_order_uidx", + "columns": [ + { + "expression": "provider", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "provider_order_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + }, + "sponsorship_orders_verification_created_idx": { + "name": "sponsorship_orders_verification_created_idx", + "columns": [ + { + "expression": "verification_status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "sponsorship_orders_fulfillment_created_idx": { + "name": "sponsorship_orders_fulfillment_created_idx", + "columns": [ + { + "expression": "fulfillment_status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "sponsorship_orders_provider_user_idx": { + "name": "sponsorship_orders_provider_user_idx", + "columns": [ + { + "expression": "provider_user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "wanjiedaoyou_sponsorship_orders_checkout_intent_id_wanjiedaoyou_sponsorship_checkout_intents_id_fk": { + "name": "wanjiedaoyou_sponsorship_orders_checkout_intent_id_wanjiedaoyou_sponsorship_checkout_intents_id_fk", + "tableFrom": "wanjiedaoyou_sponsorship_orders", + "columnsFrom": [ + "checkout_intent_id" + ], + "tableTo": "wanjiedaoyou_sponsorship_checkout_intents", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_tower_enemy_floors": { + "name": "wanjiedaoyou_tower_enemy_floors", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "season_key": { + "name": "season_key", + "type": "varchar(40)", + "primaryKey": false, + "notNull": true + }, + "realm": { + "name": "realm", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true + }, + "floor": { + "name": "floor", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true, + "default": "'ready'" + }, + "schema_version": { + "name": "schema_version", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "enemy": { + "name": "enemy", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "generated_at": { + "name": "generated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "error_message": { + "name": "error_message", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "tower_enemy_floors_season_realm_floor_uidx": { + "name": "tower_enemy_floors_season_realm_floor_uidx", + "columns": [ + { + "expression": "season_key", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "realm", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "floor", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + }, + "tower_enemy_floors_realm_floor_generated_idx": { + "name": "tower_enemy_floors_realm_floor_generated_idx", + "columns": [ + { + "expression": "realm", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "floor", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "generated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "tower_enemy_floors_season_realm_status_idx": { + "name": "tower_enemy_floors_season_realm_status_idx", + "columns": [ + { + "expression": "season_key", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "realm", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.wanjiedaoyou_transactional_messages": { + "name": "wanjiedaoyou_transactional_messages", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "message_key": { + "name": "message_key", + "type": "varchar(128)", + "primaryKey": false, + "notNull": true + }, + "destination": { + "name": "destination", + "type": "varchar(160)", + "primaryKey": false, + "notNull": true + }, + "payload": { + "name": "payload", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "deduplication_key": { + "name": "deduplication_key", + "type": "varchar(256)", + "primaryKey": false, + "notNull": false + }, + "published_at": { + "name": "published_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "publish_attempts": { + "name": "publish_attempts", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "last_publish_error": { + "name": "last_publish_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "transactional_messages_dedupe_unique": { + "name": "transactional_messages_dedupe_unique", + "columns": [ + { + "expression": "message_key", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "deduplication_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "where": "\"wanjiedaoyou_transactional_messages\".\"deduplication_key\" is not null", + "concurrently": false + }, + "transactional_messages_pending_idx": { + "name": "transactional_messages_pending_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "where": "\"wanjiedaoyou_transactional_messages\".\"published_at\" is null", + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": {}, + "schemas": {}, + "views": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/drizzle/meta/_journal.json b/drizzle/meta/_journal.json index f206c26c..48053698 100644 --- a/drizzle/meta/_journal.json +++ b/drizzle/meta/_journal.json @@ -344,6 +344,13 @@ "when": 1789465138319, "tag": "0048_competitive_replay_retention", "breakpoints": true + }, + { + "idx": 49, + "version": "7", + "when": 1789533721588, + "tag": "0049_manual_first_release", + "breakpoints": true } ] } \ No newline at end of file diff --git a/src/react-app/components/feature/items/presentation/basic.ts b/src/react-app/components/feature/items/presentation/basic.ts index d49e4833..ec97739f 100644 --- a/src/react-app/components/feature/items/presentation/basic.ts +++ b/src/react-app/components/feature/items/presentation/basic.ts @@ -7,6 +7,7 @@ import { } from '@shared/engine/combat-v6/beasts/content'; import { BEAST_REFINEMENT } from '@shared/engine/combat-v6/beasts/refinement-config'; import { CHARACTER_MANUALS_V1 } from '@shared/engine/combat-v6/manuals/content'; +import { manualEffectLines } from '@shared/engine/combat-v6/manuals/presentation'; import { EQUIPMENT_SLOT_NAMES } from '@shared/items/definitions/equipment-blueprints'; import { MATERIAL_TYPE_NAMES } from '@shared/items/definitions/materials'; import { SeedFactsSchema } from '@shared/items/definitions/seeds'; @@ -116,7 +117,18 @@ export const manualAdapter: ItemAdapter = (item, def) => { field('传承境界', manual.realm), quantity(item, options), ], - sections: [{ title: '所载功法', entries: lines(manual.description) }], + sections: [ + { + title: '所载功法', + entries: lines( + [ + ...manualEffectLines(manual, 1), + '九层:' + manualEffectLines(manual, 9).join(';'), + manual.description, + ].join('\n'), + ), + }, + ], description: '封存功法传承的玉简,可于悟道室参悟其中法门。', }), }; diff --git a/src/react-app/components/feature/manuals/ManualJadePicker.tsx b/src/react-app/components/feature/manuals/ManualJadePicker.tsx index 3d15bbc7..4b5a7e32 100644 --- a/src/react-app/components/feature/manuals/ManualJadePicker.tsx +++ b/src/react-app/components/feature/manuals/ManualJadePicker.tsx @@ -9,7 +9,7 @@ import { manualSlot } from '@shared/engine/combat-v6/manuals/compiler'; import { CHARACTER_MANUALS_V1 } from '@shared/engine/combat-v6/manuals/content'; import type { CharacterManualDefV1 } from '@shared/engine/combat-v6/manuals/types'; import { itemDefinition } from '@shared/inventory'; -import { previewManualAction } from '@shared/manuals/action'; +import { manualJadeCost, previewManualAction } from '@shared/manuals/action'; import { InventoryItems } from '../items/InventoryItems'; export function ManualJadePicker({ @@ -25,6 +25,10 @@ export function ManualJadePicker({ disabled: boolean; onChoose: (action: ManualAction) => void; }) { + const jadeCost = + manualId && view.state + ? manualJadeCost(view.state, { action: 'unlock', manualId }) + : 1; const bag = useInventoryBag(); const items = bag.data?.items ?? []; const choices = items.flatMap((item) => { @@ -68,7 +72,7 @@ export function ManualJadePicker({ />
{manualId - ? '选择一本同名玉简,突破当前瓶颈。' + ? `选择同名玉简,本次突破消耗 ${jadeCost} 本。` : `选择一本${realm}功法玉简,开始修习。`}
{bag.error ? ( @@ -79,7 +83,7 @@ export function ManualJadePicker({ {bag.data && !bag.error && choices.length === 0 ? ({manualId - ? '物品栏中暂无可用于突破的同名玉简。' + ? `物品栏中暂无数量足够的同名玉简,本次需要 ${jadeCost} 本。` : `物品栏中暂无可学习的${realm}功法玉简。`}
) : null} diff --git a/src/react-app/components/feature/manuals/ManualRealmSlot.tsx b/src/react-app/components/feature/manuals/ManualRealmSlot.tsx index d4e5751a..748d26d2 100644 --- a/src/react-app/components/feature/manuals/ManualRealmSlot.tsx +++ b/src/react-app/components/feature/manuals/ManualRealmSlot.tsx @@ -1,3 +1,4 @@ +import { manualAttributeValue } from '@shared/engine/combat-v6/manuals/attributes'; import { MAX_MANUALS_PER_SLOT } from '@shared/engine/combat-v6/manuals/compiler'; import { manualRule } from '@shared/engine/combat-v6/manuals/content'; import type { @@ -146,7 +147,6 @@ export function ManualRealmSlot({ {current.name} {progress?.level} 层 - {current.rarity === 'rare' ? ' · 珍稀' : ''} {manuals.length > 1 ? ( @@ -166,7 +166,7 @@ export function ManualRealmSlot({ {CHARACTER_ATTRIBUTE_LABELS[effect.attribute]}{' '} - +{effect.valuePerLevel * (progress?.level ?? 1)} + +{manualAttributeValue(effect, progress?.level ?? 1)} ))} diff --git a/src/react-app/components/feature/manuals/ManualRoom.tsx b/src/react-app/components/feature/manuals/ManualRoom.tsx index 853f7a54..3f65dc10 100644 --- a/src/react-app/components/feature/manuals/ManualRoom.tsx +++ b/src/react-app/components/feature/manuals/ManualRoom.tsx @@ -18,10 +18,10 @@ import { manualRule, } from '@shared/engine/combat-v6/manuals/content'; import { MANUAL_REALMS } from '@shared/engine/combat-v6/manuals/pack'; +import { manualEffectLines } from '@shared/engine/combat-v6/manuals/presentation'; import type { CharacterManualDefV1 } from '@shared/engine/combat-v6/manuals/types'; import { itemDefinition } from '@shared/inventory'; -import { CHARACTER_ATTRIBUTE_LABELS } from '@shared/lib/characterAttributeLabels'; -import { previewManualAction } from '@shared/manuals/action'; +import { manualJadeCost, previewManualAction } from '@shared/manuals/action'; import { useEffect, useRef, useState } from 'react'; import { useSearchParams } from 'react-router'; import { combatV6Request, mutationBody } from '../combat-v6/request'; @@ -30,14 +30,7 @@ import { ManualRealmSlot } from './ManualRealmSlot'; const endpoint = '/api/combat-v6/manuals'; function effects(manual: CharacterManualDefV1, level: number) { - return manual.effects - .map( - (e) => - CHARACTER_ATTRIBUTE_LABELS[e.attribute] + - ' +' + - e.valuePerLevel * level, - ) - .join(' · '); + return manualEffectLines(manual, level).join(';'); } export function ManualRoom() { @@ -323,15 +316,13 @@ export function ManualRoom() {{manual.description}
- {manual.realm} · {manual.rarity === 'rare' ? '珍稀' : '常见'} ·{' '} + {manual.realm} ·{' '} {learned ? learned.level + '/' + rule.maxLevel + '层' : '未习得'}
-{effects(manual, learned?.level ?? 1)}
+{effects(manual, learned?.level ?? 1)}
{learned ? '圆满效果:' : '一层即可获得上述效果;圆满效果:'} - - {effects(manual, rule.maxLevel)} - + {effects(manual, rule.maxLevel)}
持有同名玉简{' '} @@ -362,7 +353,7 @@ export function ManualRoom() { {learnedInRealm}/{MAX_MANUALS_PER_SLOT} {' '} - 种。最多学习三种,暂不支持遗忘或替换,请谨慎选择。 + 种。最多收藏六种,同位仅一本生效,可免费切换。
) : null} {learned?.level === rule.maxLevel ? ( @@ -370,7 +361,16 @@ export function ManualRoom() { ) : ( <> {nextKind === 'unlock' ? ( -已遇瓶颈,需一本同名玉简解锁后续层数。
++ 已遇瓶颈,需{' '} + + {manualJadeCost(view.state!, { + action: 'unlock', + manualId: manual.id, + })} + {' '} + 本同名玉简解锁后续层数。 +
) : null} {!confirmation ? (该境界位已学满三种功法,不能继续学习新的功法。
+该境界位已学满六种功法,不能继续学习新的功法。
) : null} {nextKind === 'train' && !preview?.ok ? ({preview?.diagnostics.map((d) => d.message).join(';') ?? - '需要一本同名玉简'} + '暂时无法修炼,请刷新核对'}
) : null} > @@ -466,7 +466,11 @@ export function ManualRoom() { > ) : (
- 消耗一本《{manual.name}》玉简
+ 消耗{' '}
+
+ {manualJadeCost(view.state!, confirmation)}
+ {' '}
+ 本《{manual.name}》玉简
{confirmation.action === 'unlock'
? ',解锁后仍需修炼升层'
: ''}
diff --git a/src/server/lib/services/combat-v6/CombatV6ManualService.ts b/src/server/lib/services/combat-v6/CombatV6ManualService.ts
index d32a84cd..6d370c9e 100644
--- a/src/server/lib/services/combat-v6/CombatV6ManualService.ts
+++ b/src/server/lib/services/combat-v6/CombatV6ManualService.ts
@@ -20,7 +20,7 @@ import type {
ManualAction,
ManualView,
} from '@shared/contracts/combatV6Manuals';
-import { previewManualAction } from '@shared/manuals/action';
+import { manualJadeCost, previewManualAction } from '@shared/manuals/action';
import type { RealmStage, RealmType } from '@shared/types/constants';
import type { CultivationProgress } from '@shared/types/cultivator';
import { and, eq } from 'drizzle-orm';
@@ -156,15 +156,16 @@ export async function mutateManuals(owner: string, action: ManualAction) {
.insert(cultivatorManualSlots)
.values({ cultivatorId: owner, ...nextSlot });
if ('item' in action) {
+ const jadeCost = manualJadeCost(manuals, action);
await saveInventoryPlan(
owner,
before,
- item.quantity === 1
+ item.quantity === jadeCost
? []
: [
{
...item,
- quantity: item.quantity - 1,
+ quantity: item.quantity - jadeCost,
revision: item.revision + 1,
},
],
diff --git a/src/shared/combat-v6/public-build.test.ts b/src/shared/combat-v6/public-build.test.ts
index d12e6650..3588d563 100644
--- a/src/shared/combat-v6/public-build.test.ts
+++ b/src/shared/combat-v6/public-build.test.ts
@@ -67,13 +67,13 @@ describe('public V6 build', () => {
const baseline = publicCombatV6Build(character, input);
input.manuals.learned = [
{ manualId: 'character_manual.changchun', level: 3, unlockedLevel: 3 },
- { manualId: 'character_manual.songhe', level: 9, unlockedLevel: 9 },
+ { manualId: 'character_manual.qingmu', level: 9, unlockedLevel: 9 },
];
input.manuals.build.slots = [{ slot: 1, manualId: 'character_manual.changchun' }];
const result = publicCombatV6Build(character, input);
expect(result.build.manuals).toEqual([{ slot: 1, manualId: 'character_manual.changchun', level: 3 }]);
- expect(JSON.stringify(result.build)).not.toContain('songhe');
- expect(result.combatPanel.maxHp - baseline.combatPanel.maxHp).toBe(24);
+ expect(JSON.stringify(result.build)).not.toContain('qingmu');
+ expect(result.combatPanel.maxHp - baseline.combatPanel.maxHp).toBe(128);
expect(character.attributes.vitality).toBe(20);
});
});
diff --git a/src/shared/engine/combat-v6/content/jiujie-pack.ts b/src/shared/engine/combat-v6/content/jiujie-pack.ts
index 352bfe20..5ba358c1 100644
--- a/src/shared/engine/combat-v6/content/jiujie-pack.ts
+++ b/src/shared/engine/combat-v6/content/jiujie-pack.ts
@@ -84,7 +84,7 @@ export function compileJiujieCombat(pack: ReturnType