Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

BATCH-1977 - migration script for batch 2.1 tables to batch 2.2 #148

Closed
wants to merge 4 commits into from

2 participants

Will Schipp Michael Minella
Will Schipp
Collaborator

updated to include individual create and insert scripts for each database

Michael Minella
Collaborator

Merged. Thanks Will!

Michael Minella mminella closed this March 22, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
28  spring-batch-core/src/main/resources/org/springframework/batch/core/2.1-to-2.2-migration-h2.sql
... ...
@@ -0,0 +1,28 @@
  1
+
  2
+--create the requisite table
  3
+
  4
+CREATE TABLE BATCH_JOB_EXECUTION_PARAMS  (
  5
+	JOB_EXECUTION_ID BIGINT NOT NULL ,
  6
+	TYPE_CD VARCHAR(6) NOT NULL ,
  7
+	KEY_NAME VARCHAR(100) NOT NULL ,
  8
+	STRING_VAL VARCHAR(250) ,
  9
+	DATE_VAL TIMESTAMP DEFAULT NULL ,
  10
+	LONG_VAL BIGINT ,
  11
+	DOUBLE_VAL DOUBLE PRECISION ,
  12
+	IDENTIFYING CHAR(1) NOT NULL ,
  13
+	constraint JOB_EXEC_PARAMS_FK foreign key (JOB_EXECUTION_ID)
  14
+	references BATCH_JOB_EXECUTION(JOB_EXECUTION_ID)
  15
+) ;
  16
+
  17
+--insert script that 'copies' existing batch_job_params to batch_job_execution_params
  18
+--sets new params to identifying ones
  19
+--verified on h2, 
  20
+
  21
+INSERT INTO BATCH_JOB_EXECUTION_PARAMS 
  22
+	( JOB_EXECUTION_ID , TYPE_CD, KEY_NAME, STRING_VAL, DATE_VAL, LONG_VAL, DOUBLE_VAL, IDENTIFYING )
  23
+SELECT 
  24
+	JE.JOB_EXECUTION_ID , JP.TYPE_CD , JP.KEY_NAME , JP.STRING_VAL , JP.DATE_VAL , JP.LONG_VAL , JP.DOUBLE_VAL , 1 
  25
+FROM 
  26
+	BATCH_JOB_PARAMS JP,BATCH_JOB_EXECUTION JE
  27
+WHERE 
  28
+	JP.JOB_INSTANCE_ID = JE.JOB_INSTANCE_ID;
28  spring-batch-core/src/main/resources/org/springframework/batch/core/2.1-to-2.2-migration-hsqldb.sql
... ...
@@ -0,0 +1,28 @@
  1
+
  2
+--create the requisite table
  3
+
  4
+CREATE TABLE BATCH_JOB_EXECUTION_PARAMS  (
  5
+	JOB_EXECUTION_ID BIGINT NOT NULL ,
  6
+	TYPE_CD VARCHAR(6) NOT NULL ,
  7
+	KEY_NAME VARCHAR(100) NOT NULL ,
  8
+	STRING_VAL VARCHAR(250) ,
  9
+	DATE_VAL TIMESTAMP DEFAULT NULL ,
  10
+	LONG_VAL BIGINT ,
  11
+	DOUBLE_VAL DOUBLE PRECISION ,
  12
+	IDENTIFYING CHAR(1) NOT NULL ,
  13
+	constraint JOB_EXEC_PARAMS_FK foreign key (JOB_EXECUTION_ID)
  14
+	references BATCH_JOB_EXECUTION(JOB_EXECUTION_ID)
  15
+) ;
  16
+
  17
+--insert script that 'copies' existing batch_job_params to batch_job_execution_params
  18
+--sets new params to identifying ones
  19
+--verified on h2, 
  20
+
  21
+INSERT INTO BATCH_JOB_EXECUTION_PARAMS 
  22
+	( JOB_EXECUTION_ID , TYPE_CD, KEY_NAME, STRING_VAL, DATE_VAL, LONG_VAL, DOUBLE_VAL, IDENTIFYING )
  23
+SELECT 
  24
+	JE.JOB_EXECUTION_ID , JP.TYPE_CD , JP.KEY_NAME , JP.STRING_VAL , JP.DATE_VAL , JP.LONG_VAL , JP.DOUBLE_VAL , 1 
  25
+FROM 
  26
+	BATCH_JOB_PARAMS JP,BATCH_JOB_EXECUTION JE
  27
+WHERE 
  28
+	JP.JOB_INSTANCE_ID = JE.JOB_INSTANCE_ID;
13  spring-batch-core/src/main/resources/org/springframework/batch/core/2.1-to-2.2-migration-insert-only.sql
... ...
@@ -0,0 +1,13 @@
  1
+
  2
+--insert script that 'copies' existing batch_job_params to batch_job_execution_params
  3
+--sets new params to identifying ones
  4
+--verified on h2, 
  5
+
  6
+INSERT INTO BATCH_JOB_EXECUTION_PARAMS 
  7
+	( JOB_EXECUTION_ID , TYPE_CD, KEY_NAME, STRING_VAL, DATE_VAL, LONG_VAL, DOUBLE_VAL, IDENTIFYING )
  8
+SELECT 
  9
+	JE.JOB_EXECUTION_ID , JP.TYPE_CD , JP.KEY_NAME , JP.STRING_VAL , JP.DATE_VAL , JP.LONG_VAL , JP.DOUBLE_VAL , 1 
  10
+FROM 
  11
+	BATCH_JOB_PARAMS JP,BATCH_JOB_EXECUTION JE
  12
+WHERE 
  13
+	JP.JOB_INSTANCE_ID = JE.JOB_INSTANCE_ID;
28  spring-batch-core/src/main/resources/org/springframework/batch/core/2.1-to-2.2-migration-mysql.sql
... ...
@@ -0,0 +1,28 @@
  1
+
  2
+--create the requisite table
  3
+
  4
+CREATE TABLE BATCH_JOB_EXECUTION_PARAMS  (
  5
+	JOB_EXECUTION_ID BIGINT NOT NULL ,
  6
+	TYPE_CD VARCHAR(6) NOT NULL ,
  7
+	KEY_NAME VARCHAR(100) NOT NULL ,
  8
+	STRING_VAL VARCHAR(250) ,
  9
+	DATE_VAL DATETIME DEFAULT NULL ,
  10
+	LONG_VAL BIGINT ,
  11
+	DOUBLE_VAL DOUBLE PRECISION ,
  12
+	IDENTIFYING CHAR(1) NOT NULL ,
  13
+	constraint JOB_EXEC_PARAMS_FK foreign key (JOB_EXECUTION_ID)
  14
+	references BATCH_JOB_EXECUTION(JOB_EXECUTION_ID)
  15
+) ENGINE=InnoDB;
  16
+
  17
+--insert script that 'copies' existing batch_job_params to batch_job_execution_params
  18
+--sets new params to identifying ones
  19
+--verified on h2, 
  20
+
  21
+INSERT INTO BATCH_JOB_EXECUTION_PARAMS 
  22
+	( JOB_EXECUTION_ID , TYPE_CD, KEY_NAME, STRING_VAL, DATE_VAL, LONG_VAL, DOUBLE_VAL, IDENTIFYING )
  23
+SELECT 
  24
+	JE.JOB_EXECUTION_ID , JP.TYPE_CD , JP.KEY_NAME , JP.STRING_VAL , JP.DATE_VAL , JP.LONG_VAL , JP.DOUBLE_VAL , 1 
  25
+FROM 
  26
+	BATCH_JOB_PARAMS JP,BATCH_JOB_EXECUTION JE
  27
+WHERE 
  28
+	JP.JOB_INSTANCE_ID = JE.JOB_INSTANCE_ID;
28  spring-batch-core/src/main/resources/org/springframework/batch/core/2.1-to-2.2-migration-oracle10g.sql
... ...
@@ -0,0 +1,28 @@
  1
+
  2
+--create the requisite table
  3
+
  4
+CREATE TABLE BATCH_JOB_EXECUTION_PARAMS  (
  5
+	JOB_EXECUTION_ID NUMBER(19,0) NOT NULL ,
  6
+	TYPE_CD VARCHAR2(6) NOT NULL ,
  7
+	KEY_NAME VARCHAR2(100) NOT NULL ,
  8
+	STRING_VAL VARCHAR2(250) ,
  9
+	DATE_VAL TIMESTAMP DEFAULT NULL ,
  10
+	LONG_VAL NUMBER(19,0) ,
  11
+	DOUBLE_VAL NUMBER ,
  12
+	IDENTIFYING CHAR(1) NOT NULL ,
  13
+	constraint JOB_EXEC_PARAMS_FK foreign key (JOB_EXECUTION_ID)
  14
+	references BATCH_JOB_EXECUTION(JOB_EXECUTION_ID)
  15
+) ;
  16
+
  17
+--insert script that 'copies' existing batch_job_params to batch_job_execution_params
  18
+--sets new params to identifying ones
  19
+--verified on h2, 
  20
+
  21
+INSERT INTO BATCH_JOB_EXECUTION_PARAMS 
  22
+	( JOB_EXECUTION_ID , TYPE_CD, KEY_NAME, STRING_VAL, DATE_VAL, LONG_VAL, DOUBLE_VAL, IDENTIFYING )
  23
+SELECT 
  24
+	JE.JOB_EXECUTION_ID , JP.TYPE_CD , JP.KEY_NAME , JP.STRING_VAL , JP.DATE_VAL , JP.LONG_VAL , JP.DOUBLE_VAL , 1 
  25
+FROM 
  26
+	BATCH_JOB_PARAMS JP,BATCH_JOB_EXECUTION JE
  27
+WHERE 
  28
+	JP.JOB_INSTANCE_ID = JE.JOB_INSTANCE_ID;
28  spring-batch-core/src/main/resources/org/springframework/batch/core/2.1-to-2.2-migration-postgresql.sql
... ...
@@ -0,0 +1,28 @@
  1
+
  2
+--create the requisite table
  3
+
  4
+CREATE TABLE BATCH_JOB_EXECUTION_PARAMS  (
  5
+	JOB_EXECUTION_ID BIGINT NOT NULL ,
  6
+	TYPE_CD VARCHAR(6) NOT NULL ,
  7
+	KEY_NAME VARCHAR(100) NOT NULL ,
  8
+	STRING_VAL VARCHAR(250) ,
  9
+	DATE_VAL TIMESTAMP DEFAULT NULL ,
  10
+	LONG_VAL BIGINT ,
  11
+	DOUBLE_VAL DOUBLE PRECISION ,
  12
+	IDENTIFYING CHAR(1) NOT NULL ,
  13
+	constraint JOB_EXEC_PARAMS_FK foreign key (JOB_EXECUTION_ID)
  14
+	references BATCH_JOB_EXECUTION(JOB_EXECUTION_ID)
  15
+) ;
  16
+
  17
+--insert script that 'copies' existing batch_job_params to batch_job_execution_params
  18
+--sets new params to identifying ones
  19
+--verified on h2, 
  20
+
  21
+INSERT INTO BATCH_JOB_EXECUTION_PARAMS 
  22
+	( JOB_EXECUTION_ID , TYPE_CD, KEY_NAME, STRING_VAL, DATE_VAL, LONG_VAL, DOUBLE_VAL, IDENTIFYING )
  23
+SELECT 
  24
+	JE.JOB_EXECUTION_ID , JP.TYPE_CD , JP.KEY_NAME , JP.STRING_VAL , JP.DATE_VAL , JP.LONG_VAL , JP.DOUBLE_VAL , 1 
  25
+FROM 
  26
+	BATCH_JOB_PARAMS JP,BATCH_JOB_EXECUTION JE
  27
+WHERE 
  28
+	JP.JOB_INSTANCE_ID = JE.JOB_INSTANCE_ID;
28  spring-batch-core/src/main/resources/org/springframework/batch/core/2.1-to-2.2-migration-sqlf.sql
... ...
@@ -0,0 +1,28 @@
  1
+
  2
+--create the requisite table
  3
+
  4
+CREATE TABLE BATCH_JOB_EXECUTION_PARAMS  (
  5
+	JOB_EXECUTION_ID BIGINT NOT NULL ,
  6
+	TYPE_CD VARCHAR(6) NOT NULL ,
  7
+	KEY_NAME VARCHAR(100) NOT NULL ,
  8
+	STRING_VAL VARCHAR(250) ,
  9
+	DATE_VAL TIMESTAMP DEFAULT NULL ,
  10
+	LONG_VAL BIGINT ,
  11
+	DOUBLE_VAL DOUBLE PRECISION ,
  12
+	IDENTIFYING CHAR(1) NOT NULL ,
  13
+	constraint JOB_EXEC_PARAMS_FK foreign key (JOB_EXECUTION_ID)
  14
+	references BATCH_JOB_EXECUTION(JOB_EXECUTION_ID)
  15
+) ;
  16
+
  17
+--insert script that 'copies' existing batch_job_params to batch_job_execution_params
  18
+--sets new params to identifying ones
  19
+--verified on h2, 
  20
+
  21
+INSERT INTO BATCH_JOB_EXECUTION_PARAMS 
  22
+	( JOB_EXECUTION_ID , TYPE_CD, KEY_NAME, STRING_VAL, DATE_VAL, LONG_VAL, DOUBLE_VAL, IDENTIFYING )
  23
+SELECT 
  24
+	JE.JOB_EXECUTION_ID , JP.TYPE_CD , JP.KEY_NAME , JP.STRING_VAL , JP.DATE_VAL , JP.LONG_VAL , JP.DOUBLE_VAL , 1 
  25
+FROM 
  26
+	BATCH_JOB_PARAMS JP,BATCH_JOB_EXECUTION JE
  27
+WHERE 
  28
+	JP.JOB_INSTANCE_ID = JE.JOB_INSTANCE_ID;
28  spring-batch-core/src/main/resources/org/springframework/batch/core/2.1-to-2.2-migration-sqlserver.sql
... ...
@@ -0,0 +1,28 @@
  1
+
  2
+--create the requisite table
  3
+
  4
+CREATE TABLE BATCH_JOB_EXECUTION_PARAMS  (
  5
+	JOB_EXECUTION_ID BIGINT NOT NULL ,
  6
+	TYPE_CD VARCHAR(6) NOT NULL ,
  7
+	KEY_NAME VARCHAR(100) NOT NULL ,
  8
+	STRING_VAL VARCHAR(250) ,
  9
+	DATE_VAL DATETIME DEFAULT NULL ,
  10
+	LONG_VAL BIGINT ,
  11
+	DOUBLE_VAL DOUBLE PRECISION ,
  12
+	IDENTIFYING CHAR(1) NOT NULL ,
  13
+	constraint JOB_EXEC_PARAMS_FK foreign key (JOB_EXECUTION_ID)
  14
+	references BATCH_JOB_EXECUTION(JOB_EXECUTION_ID)
  15
+) ;
  16
+
  17
+--insert script that 'copies' existing batch_job_params to batch_job_execution_params
  18
+--sets new params to identifying ones
  19
+--verified on h2, 
  20
+
  21
+INSERT INTO BATCH_JOB_EXECUTION_PARAMS 
  22
+	( JOB_EXECUTION_ID , TYPE_CD, KEY_NAME, STRING_VAL, DATE_VAL, LONG_VAL, DOUBLE_VAL, IDENTIFYING )
  23
+SELECT 
  24
+	JE.JOB_EXECUTION_ID , JP.TYPE_CD , JP.KEY_NAME , JP.STRING_VAL , JP.DATE_VAL , JP.LONG_VAL , JP.DOUBLE_VAL , 1 
  25
+FROM 
  26
+	BATCH_JOB_PARAMS JP,BATCH_JOB_EXECUTION JE
  27
+WHERE 
  28
+	JP.JOB_INSTANCE_ID = JE.JOB_INSTANCE_ID;
28  spring-batch-core/src/main/resources/org/springframework/batch/core/2.1-to-2.2-migration-sybase.sql
... ...
@@ -0,0 +1,28 @@
  1
+
  2
+--create the requisite table
  3
+
  4
+CREATE TABLE BATCH_JOB_EXECUTION_PARAMS  (
  5
+	JOB_EXECUTION_ID BIGINT NOT NULL ,
  6
+	TYPE_CD VARCHAR(6) NOT NULL ,
  7
+	KEY_NAME VARCHAR(100) NOT NULL ,
  8
+	STRING_VAL VARCHAR(250) NULL,
  9
+	DATE_VAL DATETIME DEFAULT NULL NULL,
  10
+	LONG_VAL BIGINT NULL,
  11
+	DOUBLE_VAL DOUBLE PRECISION NULL,
  12
+	IDENTIFYING CHAR(1) NOT NULL ,
  13
+	constraint JOB_EXEC_PARAMS_FK foreign key (JOB_EXECUTION_ID)
  14
+	references BATCH_JOB_EXECUTION(JOB_EXECUTION_ID)
  15
+) ;
  16
+
  17
+--insert script that 'copies' existing batch_job_params to batch_job_execution_params
  18
+--sets new params to identifying ones
  19
+--verified on h2, 
  20
+
  21
+INSERT INTO BATCH_JOB_EXECUTION_PARAMS 
  22
+	( JOB_EXECUTION_ID , TYPE_CD, KEY_NAME, STRING_VAL, DATE_VAL, LONG_VAL, DOUBLE_VAL, IDENTIFYING )
  23
+SELECT 
  24
+	JE.JOB_EXECUTION_ID , JP.TYPE_CD , JP.KEY_NAME , JP.STRING_VAL , JP.DATE_VAL , JP.LONG_VAL , JP.DOUBLE_VAL , 1 
  25
+FROM 
  26
+	BATCH_JOB_PARAMS JP,BATCH_JOB_EXECUTION JE
  27
+WHERE 
  28
+	JP.JOB_INSTANCE_ID = JE.JOB_INSTANCE_ID;
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.