/*
================================================================================
MARS-1056: Rollback FILE_MANAGER packages to pre-MARS-1056 versions
Author: Grzegorz Michalski
Date: November 25, 2025
Purpose: Rollback packages to versions before VARCHAR2 changes
================================================================================
*/

SET SERVEROUTPUT ON SIZE UNLIMITED

PROMPT ===================================================================
PROMPT MARS-1056: Rolling back to pre-MARS-1056 package versions
PROMPT WARNING: This will restore original VARCHAR2 definition behavior
PROMPT ===================================================================

-- Rollback FILE_MANAGER to current_version
PROMPT Rolling back FILE_MANAGER package...
@@current_version/FILE_MANAGER.pkg
@@current_version/FILE_MANAGER.pkb

-- Verify compilation (ADMIN user checks CT_MRDS schema)
SELECT object_name, object_type, status 
FROM all_objects 
WHERE owner = 'CT_MRDS'
  AND object_name = 'FILE_MANAGER' 
  AND object_type IN ('PACKAGE', 'PACKAGE BODY')
ORDER BY object_name, object_type;

-- Check for compilation errors (ADMIN user checks CT_MRDS schema)
SELECT name, type, line, text FROM all_errors 
WHERE owner = 'CT_MRDS'
  AND name = 'FILE_MANAGER';

PROMPT ===================================================================
PROMPT MARS-1056: Rollback completed - packages restored to pre-MARS-1056 state
PROMPT VARCHAR2 definitions will use original (data_length) behavior
PROMPT ===================================================================

/