-- ============================================= -- Education 模块 — Ticket #8 迁移回滚 -- 004-education-submit-report-rollback.sql -- ============================================= -- -- WARNING: This file contains NO executable SQL. -- Destructive rollback requires manual operator verification. -- -- Manual rollback procedure (operator must execute): -- 1. Verify no other tables depend on these tables: -- SELECT TABLE_NAME, COLUMN_NAME, REFERENCED_TABLE_NAME -- FROM information_schema.KEY_COLUMN_USAGE -- WHERE REFERENCED_TABLE_NAME IN ('education_submit_idempotency', -- 'education_practice_report', 'education_practice_report_detail') -- AND TABLE_SCHEMA = DATABASE(); -- Result MUST be empty before proceeding. -- -- 2. Verify columns are not referenced by application code: -- Search codebase for 'correct_answer' / 'explanation' references in -- education_practice_question to confirm no other consumers. -- -- 3. Verify the tables contain only data from this migration: -- SELECT COUNT(*) AS idempotency_count FROM education_submit_idempotency; -- SELECT COUNT(*) AS report_count FROM education_practice_report; -- SELECT COUNT(*) AS detail_count FROM education_practice_report_detail; -- Operator must confirm these counts are acceptable to destroy. -- -- 4. After verification, execute: -- DROP TABLE IF EXISTS education_practice_report_detail; -- DROP TABLE IF EXISTS education_practice_report; -- DROP TABLE IF EXISTS education_submit_idempotency; -- ALTER TABLE education_practice_question -- DROP COLUMN correct_answer, -- DROP COLUMN explanation; -- -- DO NOT uncomment or execute the lines below without operator verification. -- -- DROP TABLE IF EXISTS education_practice_report_detail; -- -- DROP TABLE IF EXISTS education_practice_report; -- -- DROP TABLE IF EXISTS education_submit_idempotency; -- -- ALTER TABLE education_practice_question -- -- DROP COLUMN correct_answer, -- -- DROP COLUMN explanation;