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