From d139a9cc090f4369715bf48acb0b76febb1523c2 Mon Sep 17 00:00:00 2001 From: kameshsr <47484458+kameshsr@users.noreply.github.com> Date: Tue, 29 Oct 2024 11:45:59 +0530 Subject: [PATCH] MOSIP-35176 corrected rollback scripts Signed-off-by: kameshsr <47484458+kameshsr@users.noreply.github.com> --- .../sql/1.2.1.0_to_1.3.0_rollback.sql | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/db_upgrade_scripts/mosip_ida/sql/1.2.1.0_to_1.3.0_rollback.sql b/db_upgrade_scripts/mosip_ida/sql/1.2.1.0_to_1.3.0_rollback.sql index 8f1fc89f78..ed9ee4bf0c 100644 --- a/db_upgrade_scripts/mosip_ida/sql/1.2.1.0_to_1.3.0_rollback.sql +++ b/db_upgrade_scripts/mosip_ida/sql/1.2.1.0_to_1.3.0_rollback.sql @@ -1,19 +1,28 @@ -- ------------------------------------------------------------------------------------------ --- Revoke script for Migrating Spring batch version to 5.0 as part of Java 21 Migration. +-- Rollback script for reverting Spring Batch version 5.0 migration as part of Java 21 migration. -- ------------------------------------------------------------------------------------------ -ALTER TABLE BATCH_STEP_EXECUTION DROP CREATE_TIME TIMESTAMP NOT NULL DEFAULT '1970-01-01 00:00:00'; -ALTER TABLE BATCH_STEP_EXECUTION ALTER COLUMN START_TIME ADD NULL; -ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ADD COLUMN DATE_VAL; -ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ADD COLUMN LONG_VAL; -ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ADD COLUMN DOUBLE_VAL; -ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ALTER COLUMN TYPE_CD TYPE VARCHAR(6); + +-- Revert the changes to BATCH_STEP_EXECUTION +ALTER TABLE BATCH_STEP_EXECUTION ALTER COLUMN START_TIME SET NOT NULL; +ALTER TABLE BATCH_STEP_EXECUTION DROP COLUMN CREATE_TIME; + +-- Revert the changes to BATCH_JOB_EXECUTION_PARAMS +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; -ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ALTER COLUMN KEY_NAME TYPE VARCHAR(100); +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; -ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ALTER COLUMN STRING_VAL TYPE VARCHAR(250); +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; -ALTER TABLE BATCH_JOB_EXECUTION ADD COLUMN JOB_CONFIGURATION_LOCATION; +ALTER TABLE BATCH_JOB_EXECUTION ADD COLUMN JOB_CONFIGURATION_LOCATION VARCHAR(2500); +-- Drop the created sequences DROP SEQUENCE BATCH_STEP_EXECUTION_SEQ; DROP SEQUENCE BATCH_JOB_EXECUTION_SEQ; -DROP SEQUENCE BATCH_JOB_SEQ; \ No newline at end of file +DROP SEQUENCE BATCH_JOB_SEQ; + +-- Drop the created indexes +DROP INDEX idx_job_name; +DROP INDEX idx_job_key;