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 index f4187760..438e5aa2 100644 --- 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 @@ -1,10 +1,4 @@ --- 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; @@ -25,3 +19,13 @@ alter table if exists batch_job_execution_context_archived2 rename constraint JO drop sequence if exists BATCH_STEP_EXECUTION_SEQ; drop sequence if exists BATCH_JOB_EXECUTION_SEQ; drop sequence if exists BATCH_JOB_SEQ; + + +-- ensure we have table names available +drop table if exists batch_job_execution CASCADE; +drop table if exists batch_job_execution_context CASCADE; +drop table if exists batch_job_execution_params CASCADE; +drop table if exists batch_job_instance CASCADE; +drop table if exists batch_step_execution CASCADE; +drop table if exists batch_step_execution_context CASCADE; +