From 4f23eed9a426cb775fa361939da031f1e0015e3a Mon Sep 17 00:00:00 2001 From: SabinaHMCTS <139119493+SabinaHMCTS@users.noreply.github.com> Date: Tue, 4 Feb 2025 15:41:44 +0000 Subject: [PATCH] Recreating spring batch tables (#456) --- .../V1_9__recreate_spring_batch_tables.sql | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/main/resources/db/migration/V1_9__recreate_spring_batch_tables.sql diff --git a/src/main/resources/db/migration/V1_9__recreate_spring_batch_tables.sql b/src/main/resources/db/migration/V1_9__recreate_spring_batch_tables.sql new file mode 100644 index 00000000..f4187760 --- /dev/null +++ b/src/main/resources/db/migration/V1_9__recreate_spring_batch_tables.sql @@ -0,0 +1,27 @@ +-- ensure we have table names available +drop table if exists batch_job_execution; +drop table if exists batch_job_execution_context; +drop table if exists batch_job_execution_params; +drop table if exists batch_job_instance; +drop table if exists batch_step_execution; +drop table if exists batch_step_execution_context; + +-- rename existing tables in environments (AAT has had successful job runs) +alter table if exists batch_step_execution_context rename to batch_step_execution_context_archived2; +alter table if exists batch_job_execution_context rename to batch_job_execution_context_archived2; +alter table if exists batch_step_execution rename to batch_step_execution_archived2; +alter table if exists batch_job_execution_params rename to batch_job_execution_params_archived2; +alter table if exists batch_job_execution rename to batch_job_execution_archived2; +alter table if exists batch_job_instance rename to batch_job_instance_archived2; + +alter table if exists batch_job_instance_archived2 rename constraint JOB_INST_UN to JOB_INST_UN_A2; +alter table if exists batch_job_execution_archived2 rename constraint JOB_INST_EXEC_FK to JOB_INST_EXEC_FK_A2; +alter table if exists batch_job_execution_params_archived2 rename constraint JOB_EXEC_PARAMS_FK to JOB_EXEC_PARAMS_FK_A2; +alter table if exists batch_step_execution_archived2 rename constraint JOB_EXEC_STEP_FK to JOB_EXEC_STEP_FK_A2; +alter table if exists batch_step_execution_context_archived2 rename constraint STEP_EXEC_CTX_FK to STEP_EXEC_CTX_FK_A2; +alter table if exists batch_job_execution_context_archived2 rename constraint JOB_EXEC_CTX_FK to JOB_EXEC_CTX_FK_A2; + +-- drop sequences +drop sequence if exists BATCH_STEP_EXECUTION_SEQ; +drop sequence if exists BATCH_JOB_EXECUTION_SEQ; +drop sequence if exists BATCH_JOB_SEQ;