Files
FullAutoWaterCheck/db/rollback_scandata_split_columns.sql

25 lines
592 B
MySQL
Raw Normal View History

2026-02-04 09:46:06 +08:00
/*
-
: 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;