Skip to content

Commit

Permalink
Recreating spring batch tables (#456)
Browse files Browse the repository at this point in the history
  • Loading branch information
SabinaHMCTS authored Feb 4, 2025
1 parent 9b4b877 commit 4f23eed
Showing 1 changed file with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 4f23eed

Please sign in to comment.