From fb4494b0d0b6554ffe722dc16e09dd605c2affc0 Mon Sep 17 00:00:00 2001 From: Mahmoud Ben Hassine Date: Tue, 9 Oct 2018 22:17:41 +0200 Subject: [PATCH] Add migration script to use characters instead of bytes for oracle db Resolves BATCH-2091 --- .../migration/{ => 2.2}/migration-db2.sql | 0 .../migration/{ => 2.2}/migration-derby.sql | 0 .../core/migration/{ => 2.2}/migration-h2.sql | 0 .../migration/{ => 2.2}/migration-hsqldb.sql | 0 .../{ => 2.2}/migration-insert-only.sql | 0 .../migration/{ => 2.2}/migration-mysql.sql | 0 .../{ => 2.2}/migration-oracle10g.sql | 0 .../{ => 2.2}/migration-postgresql.sql | 0 .../migration/{ => 2.2}/migration-sqlf.sql | 0 .../{ => 2.2}/migration-sqlserver.sql | 0 .../migration/{ => 2.2}/migration-sybase.sql | 0 .../migration/4.1/migration-oracle10g.sql | 19 +++++++++++++++++++ .../asciidoc/schema-appendix.adoc | 10 ++++++++++ 13 files changed, 29 insertions(+) rename spring-batch-core/src/main/resources/org/springframework/batch/core/migration/{ => 2.2}/migration-db2.sql (100%) rename spring-batch-core/src/main/resources/org/springframework/batch/core/migration/{ => 2.2}/migration-derby.sql (100%) rename spring-batch-core/src/main/resources/org/springframework/batch/core/migration/{ => 2.2}/migration-h2.sql (100%) rename spring-batch-core/src/main/resources/org/springframework/batch/core/migration/{ => 2.2}/migration-hsqldb.sql (100%) rename spring-batch-core/src/main/resources/org/springframework/batch/core/migration/{ => 2.2}/migration-insert-only.sql (100%) rename spring-batch-core/src/main/resources/org/springframework/batch/core/migration/{ => 2.2}/migration-mysql.sql (100%) rename spring-batch-core/src/main/resources/org/springframework/batch/core/migration/{ => 2.2}/migration-oracle10g.sql (100%) rename spring-batch-core/src/main/resources/org/springframework/batch/core/migration/{ => 2.2}/migration-postgresql.sql (100%) rename spring-batch-core/src/main/resources/org/springframework/batch/core/migration/{ => 2.2}/migration-sqlf.sql (100%) rename spring-batch-core/src/main/resources/org/springframework/batch/core/migration/{ => 2.2}/migration-sqlserver.sql (100%) rename spring-batch-core/src/main/resources/org/springframework/batch/core/migration/{ => 2.2}/migration-sybase.sql (100%) create mode 100644 spring-batch-core/src/main/resources/org/springframework/batch/core/migration/4.1/migration-oracle10g.sql diff --git a/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-db2.sql b/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/2.2/migration-db2.sql similarity index 100% rename from spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-db2.sql rename to spring-batch-core/src/main/resources/org/springframework/batch/core/migration/2.2/migration-db2.sql diff --git a/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-derby.sql b/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/2.2/migration-derby.sql similarity index 100% rename from spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-derby.sql rename to spring-batch-core/src/main/resources/org/springframework/batch/core/migration/2.2/migration-derby.sql diff --git a/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-h2.sql b/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/2.2/migration-h2.sql similarity index 100% rename from spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-h2.sql rename to spring-batch-core/src/main/resources/org/springframework/batch/core/migration/2.2/migration-h2.sql diff --git a/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-hsqldb.sql b/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/2.2/migration-hsqldb.sql similarity index 100% rename from spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-hsqldb.sql rename to spring-batch-core/src/main/resources/org/springframework/batch/core/migration/2.2/migration-hsqldb.sql diff --git a/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-insert-only.sql b/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/2.2/migration-insert-only.sql similarity index 100% rename from spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-insert-only.sql rename to spring-batch-core/src/main/resources/org/springframework/batch/core/migration/2.2/migration-insert-only.sql diff --git a/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-mysql.sql b/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/2.2/migration-mysql.sql similarity index 100% rename from spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-mysql.sql rename to spring-batch-core/src/main/resources/org/springframework/batch/core/migration/2.2/migration-mysql.sql diff --git a/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-oracle10g.sql b/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/2.2/migration-oracle10g.sql similarity index 100% rename from spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-oracle10g.sql rename to spring-batch-core/src/main/resources/org/springframework/batch/core/migration/2.2/migration-oracle10g.sql diff --git a/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-postgresql.sql b/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/2.2/migration-postgresql.sql similarity index 100% rename from spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-postgresql.sql rename to spring-batch-core/src/main/resources/org/springframework/batch/core/migration/2.2/migration-postgresql.sql diff --git a/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-sqlf.sql b/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/2.2/migration-sqlf.sql similarity index 100% rename from spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-sqlf.sql rename to spring-batch-core/src/main/resources/org/springframework/batch/core/migration/2.2/migration-sqlf.sql diff --git a/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-sqlserver.sql b/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/2.2/migration-sqlserver.sql similarity index 100% rename from spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-sqlserver.sql rename to spring-batch-core/src/main/resources/org/springframework/batch/core/migration/2.2/migration-sqlserver.sql diff --git a/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-sybase.sql b/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/2.2/migration-sybase.sql similarity index 100% rename from spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-sybase.sql rename to spring-batch-core/src/main/resources/org/springframework/batch/core/migration/2.2/migration-sybase.sql diff --git a/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/4.1/migration-oracle10g.sql b/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/4.1/migration-oracle10g.sql new file mode 100644 index 000000000..79c931b1c --- /dev/null +++ b/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/4.1/migration-oracle10g.sql @@ -0,0 +1,19 @@ +ALTER TABLE BATCH_JOB_INSTANCE MODIFY JOB_NAME VARCHAR2(100 char); +ALTER TABLE BATCH_JOB_INSTANCE MODIFY JOB_KEY VARCHAR2(32 char); + +ALTER TABLE BATCH_JOB_EXECUTION MODIFY STATUS VARCHAR2(10 char); +ALTER TABLE BATCH_JOB_EXECUTION MODIFY EXIT_CODE VARCHAR2(2500 char); +ALTER TABLE BATCH_JOB_EXECUTION MODIFY EXIT_MESSAGE VARCHAR2(2500 char); +ALTER TABLE BATCH_JOB_EXECUTION MODIFY JOB_CONFIGURATION_LOCATION VARCHAR2(2500 char); + +ALTER TABLE BATCH_JOB_EXECUTION_PARAMS MODIFY TYPE_CD VARCHAR2(6 char); +ALTER TABLE BATCH_JOB_EXECUTION_PARAMS MODIFY KEY_NAME VARCHAR2(100 char); +ALTER TABLE BATCH_JOB_EXECUTION_PARAMS MODIFY STRING_VAL VARCHAR2(250 char); + +ALTER TABLE BATCH_STEP_EXECUTION MODIFY STEP_NAME VARCHAR2(100 char); +ALTER TABLE BATCH_STEP_EXECUTION MODIFY STATUS VARCHAR2(10 char); +ALTER TABLE BATCH_STEP_EXECUTION MODIFY EXIT_CODE VARCHAR2(2500 char); +ALTER TABLE BATCH_STEP_EXECUTION MODIFY EXIT_MESSAGE VARCHAR2(2500 char); + +ALTER TABLE BATCH_STEP_EXECUTION_CONTEXT MODIFY SHORT_CONTEXT VARCHAR2(2500 char); +ALTER TABLE BATCH_JOB_EXECUTION_CONTEXT MODIFY SHORT_CONTEXT VARCHAR2(2500 char); diff --git a/spring-batch-docs/asciidoc/schema-appendix.adoc b/spring-batch-docs/asciidoc/schema-appendix.adoc index 7620e42e6..a5ac341dd 100644 --- a/spring-batch-docs/asciidoc/schema-appendix.adoc +++ b/spring-batch-docs/asciidoc/schema-appendix.adoc @@ -35,6 +35,16 @@ modified with additional indexes and constraints as desired. The file names are form `schema-\*.sql`, where "*" is the short name of the target database platform. The scripts are in the package `org.springframework.batch.core`. +[[migrationDDLScripts]] +==== Migration DDL Scripts + +Spring Batch provides migration DDL scripts that you need to execute when you upgrade versions. +These scripts can be found in the Core Jar file under `org/springframework/batch/core/migration`. +Migration scripts are organized into folders corresponding to version numbers in which they were introduced: + +* `2.2`: contains scripts needed if you are migrating from a version before `2.2` to version `2.2` +* `4.1`: contains scripts needed if you are migrating from a version before `4.1` to version `4.1` + [[metaDataVersion]] ==== Version