generated from hmcts/spring-boot-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add files via upload recreates spring-batch tables and sequences * Update V1_30__recreate_spring_batch_tables.sql
- Loading branch information
1 parent
cd69668
commit aff103a
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
src/main/resources/db/migration/V1_30__recreate_spring_batch_tables.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_step_execution_context_archived2; | ||
drop table if exists batch_job_execution_context_archived2; | ||
drop table if exists batch_step_execution_archived2; | ||
drop table if exists batch_job_execution_params_archived2; | ||
drop table if exists batch_job_execution_archived2; | ||
drop table if exists batch_job_instance_archived2; | ||
|
||
-- 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; |