-- MARS-828: Rollback archival strategy columns
-- Author: Grzegorz Michalski
-- Date: 2026-01-27
-- Description: Remove ARCHIVAL_STRATEGY and MINIMUM_AGE_MONTHS columns

PROMPT ========================================
PROMPT MARS-828: Removing archival strategy columns
PROMPT ========================================

-- Drop check constraint first
ALTER TABLE CT_MRDS.A_SOURCE_FILE_CONFIG 
DROP CONSTRAINT CHK_ARCHIVAL_STRATEGY;

-- Drop columns
ALTER TABLE CT_MRDS.A_SOURCE_FILE_CONFIG DROP (
    ARCHIVAL_STRATEGY,
    MINIMUM_AGE_MONTHS
);

-- Verify columns dropped
SELECT 
    column_name
FROM all_tab_columns 
WHERE owner = 'CT_MRDS' 
  AND table_name = 'A_SOURCE_FILE_CONFIG'
  AND column_name IN ('ARCHIVAL_STRATEGY', 'MINIMUM_AGE_MONTHS');

PROMPT ========================================
PROMPT Archival strategy columns removed successfully
PROMPT ========================================
