Skip to content

Commit

Permalink
MOSIP-31576 corrected rollback scripts
Browse files Browse the repository at this point in the history
Signed-off-by: kameshsr <[email protected]>
  • Loading branch information
kameshsr committed Oct 29, 2024
1 parent 320c8d3 commit c12ad2a
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions db_upgrade_scripts/mosip_ida/sql/1.2.1.0_to_1.3.0_rollback.sql
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
-- ------------------------------------------------------------------------------------------
-- Rollback script for reverting Spring Batch version 5.0 migration as part of Java 21 migration.
-- Rollback script for Reverting Spring Batch version upgrade changes.
-- ------------------------------------------------------------------------------------------

-- Revert the changes to BATCH_STEP_EXECUTION
ALTER TABLE BATCH_STEP_EXECUTION ALTER COLUMN START_TIME SET NOT NULL;
-- Reverse the addition of the CREATE_TIME column
ALTER TABLE BATCH_STEP_EXECUTION DROP COLUMN CREATE_TIME;

-- Revert the changes to BATCH_JOB_EXECUTION_PARAMS
-- Reverse the modification of START_TIME column
ALTER TABLE BATCH_STEP_EXECUTION ALTER COLUMN START_TIME SET NOT NULL;

-- Reverse the removal of DATE_VAL, LONG_VAL, and DOUBLE_VAL columns
ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ADD COLUMN DATE_VAL TIMESTAMP;
ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ADD COLUMN LONG_VAL BIGINT;
ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ADD COLUMN DOUBLE_VAL DOUBLE PRECISION;
ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ALTER COLUMN PARAMETER_TYPE TYPE CHAR(6);

ALTER TABLE BATCH_JOB_EXECUTION_PARAMS RENAME PARAMETER_TYPE TO TYPE_CD;

-- Reverse the modifications and renaming of KEY_NAME to PARAMETER_NAME
ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ALTER COLUMN PARAMETER_NAME TYPE VARCHAR(100);
ALTER TABLE BATCH_JOB_EXECUTION_PARAMS RENAME PARAMETER_NAME TO KEY_NAME;

-- Reverse the modifications and renaming of STRING_VAL to PARAMETER_VALUE
ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ALTER COLUMN PARAMETER_VALUE TYPE VARCHAR(250);
ALTER TABLE BATCH_JOB_EXECUTION_PARAMS RENAME PARAMETER_VALUE TO STRING_VAL;

-- Reverse the dropping of JOB_CONFIGURATION_LOCATION column
ALTER TABLE BATCH_JOB_EXECUTION ADD COLUMN JOB_CONFIGURATION_LOCATION VARCHAR(2500);

-- Drop the created indexes
DROP INDEX idx_job_name;
DROP INDEX idx_job_key;
-- Reverse the creation of indexes
DROP INDEX IF EXISTS idx_job_name;
DROP INDEX IF EXISTS idx_job_key;

0 comments on commit c12ad2a

Please sign in to comment.