Skip to content

Commit a722cd2

Browse files
committed
Refine contribution #4099
- Add migration script for SQLITE - Update the script of SAP HANA with the new column
1 parent 464985b commit a722cd2

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
ALTER TABLE BATCH_STEP_EXECUTION ADD CREATE_TIME TIMESTAMP NOT NULL DEFAULT '1970-01-01 00:00:00';
2+
-- ALTER TABLE BATCH_STEP_EXECUTION ALTER COLUMN START_TIME DROP NOT NULL;
3+
-- ALTER COLUMN is not supported in SQLITE: https://www.sqlite.org/lang_altertable.html
4+
-- There are several ways to drop the 'NOT NULL' constraint on START_TIME, this is left to the user.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
ALTER TABLE BATCH_STEP_EXECUTION ADD CREATE_TIME DATETIME DEFAULT '1970-01-01 00:00:00' NOT NULL;
22
ALTER TABLE BATCH_STEP_EXECUTION MODIFY START_TIME DATETIME NULL;
3-
??

spring-batch-core/src/main/resources/org/springframework/batch/core/schema-hana.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ CREATE TABLE BATCH_STEP_EXECUTION (
4141
VERSION BIGINT NOT NULL,
4242
STEP_NAME VARCHAR(100) NOT NULL,
4343
JOB_EXECUTION_ID BIGINT NOT NULL,
44-
START_TIME TIMESTAMP NOT NULL ,
44+
CREATE_TIME TIMESTAMP NOT NULL ,
45+
START_TIME TIMESTAMP DEFAULT NULL ,
4546
END_TIME TIMESTAMP DEFAULT NULL ,
4647
STATUS VARCHAR(10) ,
4748
COMMIT_COUNT BIGINT ,

0 commit comments

Comments
 (0)