-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FEAT: (#84) Spring Batch MySQL DDL을 추가한다
- Loading branch information
Showing
1 changed file
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
CREATE TABLE BATCH_JOB_INSTANCE ( | ||
JOB_INSTANCE_ID BIGINT NOT NULL PRIMARY KEY , | ||
VERSION BIGINT , | ||
JOB_NAME VARCHAR(100) NOT NULL, | ||
JOB_KEY VARCHAR(32) NOT NULL, | ||
constraint JOB_INST_UN unique (JOB_NAME, JOB_KEY) | ||
) ENGINE=InnoDB; | ||
|
||
CREATE TABLE BATCH_JOB_EXECUTION ( | ||
JOB_EXECUTION_ID BIGINT NOT NULL PRIMARY KEY , | ||
VERSION BIGINT , | ||
JOB_INSTANCE_ID BIGINT NOT NULL, | ||
CREATE_TIME DATETIME(6) NOT NULL, | ||
START_TIME DATETIME(6) DEFAULT NULL , | ||
END_TIME DATETIME(6) DEFAULT NULL , | ||
STATUS VARCHAR(10) , | ||
EXIT_CODE VARCHAR(2500) , | ||
EXIT_MESSAGE VARCHAR(2500) , | ||
LAST_UPDATED DATETIME(6), | ||
constraint JOB_INST_EXEC_FK foreign key (JOB_INSTANCE_ID) | ||
references BATCH_JOB_INSTANCE(JOB_INSTANCE_ID) | ||
) ENGINE=InnoDB; | ||
|
||
CREATE TABLE BATCH_JOB_EXECUTION_PARAMS ( | ||
JOB_EXECUTION_ID BIGINT NOT NULL , | ||
PARAMETER_NAME VARCHAR(100) NOT NULL , | ||
PARAMETER_TYPE VARCHAR(100) NOT NULL , | ||
PARAMETER_VALUE VARCHAR(2500) , | ||
IDENTIFYING CHAR(1) NOT NULL , | ||
constraint JOB_EXEC_PARAMS_FK foreign key (JOB_EXECUTION_ID) | ||
references BATCH_JOB_EXECUTION(JOB_EXECUTION_ID) | ||
) ENGINE=InnoDB; | ||
|
||
CREATE TABLE BATCH_STEP_EXECUTION ( | ||
STEP_EXECUTION_ID BIGINT NOT NULL PRIMARY KEY , | ||
VERSION BIGINT NOT NULL, | ||
STEP_NAME VARCHAR(100) NOT NULL, | ||
JOB_EXECUTION_ID BIGINT NOT NULL, | ||
CREATE_TIME DATETIME(6) NOT NULL, | ||
START_TIME DATETIME(6) DEFAULT NULL , | ||
END_TIME DATETIME(6) DEFAULT NULL , | ||
STATUS VARCHAR(10) , | ||
COMMIT_COUNT BIGINT , | ||
READ_COUNT BIGINT , | ||
FILTER_COUNT BIGINT , | ||
WRITE_COUNT BIGINT , | ||
READ_SKIP_COUNT BIGINT , | ||
WRITE_SKIP_COUNT BIGINT , | ||
PROCESS_SKIP_COUNT BIGINT , | ||
ROLLBACK_COUNT BIGINT , | ||
EXIT_CODE VARCHAR(2500) , | ||
EXIT_MESSAGE VARCHAR(2500) , | ||
LAST_UPDATED DATETIME(6), | ||
constraint JOB_EXEC_STEP_FK foreign key (JOB_EXECUTION_ID) | ||
references BATCH_JOB_EXECUTION(JOB_EXECUTION_ID) | ||
) ENGINE=InnoDB; | ||
|
||
CREATE TABLE BATCH_STEP_EXECUTION_CONTEXT ( | ||
STEP_EXECUTION_ID BIGINT NOT NULL PRIMARY KEY, | ||
SHORT_CONTEXT VARCHAR(2500) NOT NULL, | ||
SERIALIZED_CONTEXT TEXT , | ||
constraint STEP_EXEC_CTX_FK foreign key (STEP_EXECUTION_ID) | ||
references BATCH_STEP_EXECUTION(STEP_EXECUTION_ID) | ||
) ENGINE=InnoDB; | ||
|
||
CREATE TABLE BATCH_JOB_EXECUTION_CONTEXT ( | ||
JOB_EXECUTION_ID BIGINT NOT NULL PRIMARY KEY, | ||
SHORT_CONTEXT VARCHAR(2500) NOT NULL, | ||
SERIALIZED_CONTEXT TEXT , | ||
constraint JOB_EXEC_CTX_FK foreign key (JOB_EXECUTION_ID) | ||
references BATCH_JOB_EXECUTION(JOB_EXECUTION_ID) | ||
) ENGINE=InnoDB; | ||
|
||
CREATE TABLE BATCH_STEP_EXECUTION_SEQ ( | ||
ID BIGINT NOT NULL, | ||
UNIQUE_KEY CHAR(1) NOT NULL, | ||
constraint UNIQUE_KEY_UN unique (UNIQUE_KEY) | ||
) ENGINE=InnoDB; | ||
|
||
INSERT INTO BATCH_STEP_EXECUTION_SEQ (ID, UNIQUE_KEY) select * from (select 0 as ID, '0' as UNIQUE_KEY) as tmp where not exists(select * from BATCH_STEP_EXECUTION_SEQ); | ||
|
||
CREATE TABLE BATCH_JOB_EXECUTION_SEQ ( | ||
ID BIGINT NOT NULL, | ||
UNIQUE_KEY CHAR(1) NOT NULL, | ||
constraint UNIQUE_KEY_UN unique (UNIQUE_KEY) | ||
) ENGINE=InnoDB; | ||
|
||
INSERT INTO BATCH_JOB_EXECUTION_SEQ (ID, UNIQUE_KEY) select * from (select 0 as ID, '0' as UNIQUE_KEY) as tmp where not exists(select * from BATCH_JOB_EXECUTION_SEQ); | ||
|
||
CREATE TABLE BATCH_JOB_SEQ ( | ||
ID BIGINT NOT NULL, | ||
UNIQUE_KEY CHAR(1) NOT NULL, | ||
constraint UNIQUE_KEY_UN unique (UNIQUE_KEY) | ||
) ENGINE=InnoDB; | ||
|
||
INSERT INTO BATCH_JOB_SEQ (ID, UNIQUE_KEY) select * from (select 0 as ID, '0' as UNIQUE_KEY) as tmp where not exists(select * from BATCH_JOB_SEQ); |