HaniBlindBox/server/scripts/migrate_goods_batch.ps1
2026-01-02 05:18:05 +08:00

34 lines
1.7 KiB
PowerShell

# ============================================================
# 商品数据迁移脚本 - goods 表
# Feature: database-migration, Property 2: 数据记录数一致性
# Feature: database-migration, Property 5: 业务配置完整性
# Validates: Requirements 2.6, 2.7
# ============================================================
# 源表: MySQL goods (503 条记录)
# 目标表: SQL Server goods
# ============================================================
Write-Host "========================================" -ForegroundColor Cyan
Write-Host "商品数据迁移脚本" -ForegroundColor Cyan
Write-Host "执行时间: $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')" -ForegroundColor Cyan
Write-Host "========================================" -ForegroundColor Cyan
Write-Host ""
# 此脚本通过 Kiro MCP 工具执行数据迁移
# 字段映射说明:
# MySQL imgurl -> SQL Server img_url
# MySQL imgurl_detail -> SQL Server img_url_detail
# MySQL prize_imgurl -> SQL Server prize_img_url
# MySQL addtime -> SQL Server created_at (Unix时间戳转换)
# MySQL update_time -> SQL Server updated_at (Unix时间戳转换)
# MySQL delete_time -> SQL Server deleted_at (Unix时间戳转换)
# MySQL lock_time -> SQL Server lock_time (Unix时间戳转换)
# MySQL sale_time -> SQL Server sale_time (Unix时间戳转换)
# MySQL flw_start_time -> SQL Server flw_start_time (Unix时间戳转换)
# MySQL flw_end_time -> SQL Server flw_end_time (Unix时间戳转换)
# MySQL open_time -> SQL Server open_time (Unix时间戳转换)
Write-Host "迁移将通过 Kiro MCP 工具执行" -ForegroundColor Yellow
Write-Host "请使用 mcp_mysql_execute_sql 和 mcp_sqlserver_execute_sql 工具" -ForegroundColor Yellow