kindergarten_java/reading-platform-java/clean-flyway-v41.sql
En 2b611f6c17 fix(V41): 修复中间表优化迁移脚本(使用存储过程处理不存在的情况)
- 使用存储过程和 IF EXISTS 检查来删除索引和字段
- 避免因为索引/字段不存在导致迁移失败
- 创建临时 FlywayCleanerConfig 用于清理失败的 v41 迁移记录
- 成功执行 V41 迁移,优化中间表结构

影响范围:
- course_collection_package: 删除 uk_collection_package 索引和 deleted 字段
- tenant_course: 删除 uk_tenant_course 索引和 deleted 字段
- class_teacher: 删除 deleted 字段

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 17:28:15 +08:00

15 lines
488 B
SQL
Raw Permalink 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.

-- =====================================================
-- 清理 Flyway 失败的 V41 迁移记录
-- 执行时间2026-03-19
-- 说明:在执行 V41 迁移脚本之前,先清理失败的迁移记录
-- =====================================================
-- 删除 V41 的失败记录
DELETE FROM flyway_schema_history WHERE version = '41';
-- 验证清理结果
SELECT version, description, state, installed_on
FROM flyway_schema_history
ORDER BY installed_on DESC
LIMIT 10;