game/addons/game_base/migrations/1.2/pre-migrate.py
李鹏宇 760cd517c2 feat: 规则货币合并+规则类别配置菜单 + 世界数据大报表 + 背景/论坛同步
后端 game_base:
- 货币并入 game.rule(rate/note 字段),新增可配置规则类别 game.rule.category(world/faction/character/currency)
- 新增「配置」菜单与规则类别配置子项
- /game/api/rules 按类别分组返回,/game/api/currencies 保持兼容
- 列表分组取消等级累计(aggregator=False,适配 Odoo18)
- 1.2 pre-migrate 清理旧 game.currency 记录,避免外部ID冲突

前端/官网:
- 世界数据大报表(index.html + .wd-* 样式)
- 背景 5 板块同步、论坛汉化、过渡资源与 views 拆分(announcement/codex/forum/page/rule/story)
2026-07-24 17:58:17 +08:00

10 lines
458 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# -*- coding: utf-8 -*-
def migrate(cr, version):
"""升级到 1.2:清理旧的 game.currency 记录与外部 ID避免合并到 game.rule 时冲突。"""
# 先删数据表记录,再删对应 ir.model.data 行
cr.execute("SELECT 1 FROM information_schema.tables WHERE table_name='game_currency'")
if cr.fetchone():
cr.execute("DELETE FROM game_currency")
cr.execute("DELETE FROM ir_model_data WHERE model='game.currency'")