feat(education): complete Flyway migration and atomic submit
This commit is contained in:
25
sql/postgresql/education/007-education-favorite-rollback.sql
Normal file
25
sql/postgresql/education/007-education-favorite-rollback.sql
Normal file
@@ -0,0 +1,25 @@
|
||||
-- =============================================
|
||||
-- Education 模块 — 收藏夹 DDL Rollback (PostgreSQL)
|
||||
-- Migration: 007
|
||||
-- =============================================
|
||||
-- IMPORTANT: This is a documentation-only rollback.
|
||||
-- No DROP/ALTER/DELETE statements are executed. The favorite
|
||||
-- table is provenance-safe: it only accumulates user preference
|
||||
-- data. Dropping this table would lose student favorites with
|
||||
-- no recovery path.
|
||||
--
|
||||
-- What this migration created:
|
||||
-- - education_favorite (new table)
|
||||
-- - idx_tenant_user (index)
|
||||
-- - idx_tenant_user_target_type (index)
|
||||
-- - uk_tenant_user_target (unique constraint)
|
||||
--
|
||||
-- Manual rollback requires:
|
||||
-- 1. Verified database backup before rollback
|
||||
-- 2. Operator approval (DBA sign-off)
|
||||
-- 3. Provenance of all favorite records preserved (exported)
|
||||
-- 4. Soft-delete via deleted = true before any hard drop
|
||||
--
|
||||
-- These tables are NOT deleted by this script. Favorite history is
|
||||
-- retained; if deletion is required by external policy, consult
|
||||
-- the DBA for a verified rollback procedure.
|
||||
Reference in New Issue
Block a user