-- =====================================================
-- ROLLBACK 06: Remove Businessunits Extensions
-- =====================================================
-- Date: 2025-11-06
-- Purpose: Rollback script 06_extend_businessunits_table.sql
-- WARNING: This will DELETE liaison data
-- =====================================================

USE shopdb;
SET SQL_SAFE_UPDATES = 0;

-- =====================================================
-- STEP 1: Drop indexes
-- =====================================================

DROP INDEX IF EXISTS idx_businessunits_liaisonsso ON businessunits;

-- =====================================================
-- STEP 2: Remove columns
-- =====================================================

ALTER TABLE businessunits
DROP COLUMN IF EXISTS liaisonname,
DROP COLUMN IF EXISTS liaisonsso;

-- =====================================================
-- VERIFICATION
-- =====================================================

SELECT '✓ Index dropped' AS status;
SELECT '✓ Columns removed from businessunits table' AS status;
DESCRIBE businessunits;
SELECT '✓ ROLLBACK 06 completed successfully' AS status;

SET SQL_SAFE_UPDATES = 1;

-- =====================================================
-- NOTES
-- =====================================================
-- Columns removed:
-- - liaisonname
-- - liaisonsso
--
-- To restore: Run 06_extend_businessunits_table.sql
-- =====================================================
