I haven't seen a script to do the DDL modification necessary to go from Spring Batch 2 -> 3 in MySQL. Curious if one exists?
Asked
Active
Viewed 8,338 times
2 Answers
19
After running a quick comparison of the schemas, these appear to be the changes for upgrading from Spring Batch 2.2.7.RELEASE -> 3.0.1.RELEASE on MySQL.
ALTER TABLE `BATCH_JOB_EXECUTION` MODIFY COLUMN `EXIT_CODE` varchar(2500) DEFAULT NULL;
ALTER TABLE `BATCH_JOB_EXECUTION` ADD COLUMN `JOB_CONFIGURATION_LOCATION` varchar(2500) DEFAULT NULL;
ALTER TABLE `BATCH_JOB_EXECUTION_SEQ` ADD COLUMN `UNIQUE_KEY` char(1) NOT NULL;
ALTER TABLE `BATCH_JOB_EXECUTION_SEQ` ADD UNIQUE KEY `UNIQUE_KEY_UN` (`UNIQUE_KEY`);
ALTER TABLE `BATCH_JOB_SEQ` ADD COLUMN `UNIQUE_KEY` char(1) NOT NULL;
ALTER TABLE `BATCH_JOB_SEQ` ADD UNIQUE KEY `UNIQUE_KEY_UN` (`UNIQUE_KEY`);
ALTER TABLE `BATCH_STEP_EXECUTION` MODIFY COLUMN `EXIT_CODE` varchar(2500) DEFAULT NULL;
ALTER TABLE `BATCH_STEP_EXECUTION_SEQ` ADD COLUMN `UNIQUE_KEY` char(1) NOT NULL;
ALTER TABLE `BATCH_STEP_EXECUTION_SEQ` ADD UNIQUE KEY `UNIQUE_KEY_UN` (`UNIQUE_KEY`);

Alex
- 855
- 7
- 21
-
Alex - Where you find these ALTER statements? Can you please provide a link for reference ? – Aug 23 '16 at 17:04
-
I reverse engineered them. – Alex Aug 24 '16 at 21:03
-
Alex - Could you pls help / guide on http://stackoverflow.com/questions/39107254/com-mysql-jdbc-exceptions-jdbc4-mysqlsyntaxerrorexception-table-spring-batch-t ? – Aug 25 '16 at 13:35
6
For anyone who wants to know the DDL
changes for postgresql
:
ALTER TABLE BATCH_JOB_EXECUTION ALTER COLUMN EXIT_CODE TYPE varchar(2500);
ALTER TABLE BATCH_JOB_EXECUTION ADD COLUMN JOB_CONFIGURATION_LOCATION varchar(2500) DEFAULT NULL;
ALTER TABLE BATCH_STEP_EXECUTION ALTER COLUMN EXIT_CODE TYPE varchar(2500);
This worked for me when I upgraded from 2.2.7.RELEASE
-> 3.0.7.RELEASE
.
Really surprised there's no migration guide/or scripts, at least that I could find.

leeor
- 17,041
- 6
- 34
- 60