HaniBlindBox/server/scripts/migrate_financial_data.sql
2026-01-02 05:18:05 +08:00

31 lines
1.1 KiB
Transact-SQL

-- ============================================================
-- 财务数据迁移脚本 - 所有财务表
-- Feature: database-migration, Property 2: 数据记录数一致性
-- Feature: database-migration, Property 4: 财务数据一致性
-- Validates: Requirements 4.7
-- ============================================================
-- 此脚本通过 Kiro MCP 工具执行数据迁移
-- 字段映射: addtime -> created_at (Unix时间戳转换)
-- 时间戳转换: DATEADD(SECOND, unix_timestamp, '1970-01-01')
-- ============================================================
USE honey_box;
GO
-- 迁移说明:
-- 由于数据量较大,迁移通过 MCP 工具分批执行
-- 每批处理约 500-1000 条记录
-- 迁移完成后需要验证记录数和财务数据一致性
-- 预期迁移记录数:
-- profit_money: 25,770 条
-- profit_integral: 33,187 条
-- profit_money2: 19,277 条
-- profit_pay: 3,211 条
-- profit_score: 0 条
-- profit_ou_qi: 8,339 条
PRINT '财务数据迁移脚本已准备就绪';
PRINT '请通过 MCP 工具执行分批迁移';
GO