Files
FullAutoWaterCheck/db/rollback_scandata_split_columns.sql
2026-02-04 09:46:06 +08:00

25 lines
592 B
SQL
Raw 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.
/*
数据库回滚脚本 - 恢复联络单号和件号合并
执行日期: 2026-02-04
目的: 如果需要回滚删除ContactNumber和ItemNumber字段
影响表: scandata
*/
USE fullautowaterpressure;
-- 1. 删除索引
DROP INDEX IF EXISTS `idx_contact_number` ON `scandata`;
DROP INDEX IF EXISTS `idx_item_number` ON `scandata`;
-- 2. 删除新增字段
ALTER TABLE `scandata`
DROP COLUMN IF EXISTS `ContactNumber`,
DROP COLUMN IF EXISTS `ItemNumber`;
-- 3. 验证回滚
DESCRIBE `scandata`;
-- 4. 显示回滚后的数据
SELECT * FROM `scandata` ORDER BY Id DESC LIMIT 10;