CREATE TABLE TB_BATCH_FILE_DATA
(
    FILE_DATA_ID   VARCHAR(20)                             NOT NULL COMMENT '파일데이터ID'
        PRIMARY KEY,
    FILE_NM      VARCHAR(255)                            NOT NULL COMMENT '파일 명',
    LINE_NUMBER    INT                                     NOT NULL COMMENT '라인 번호',
    COLUMN1        VARCHAR(100)                            NULL COMMENT '컬럼1',
    COLUMN2        VARCHAR(100)                            NULL COMMENT '컬럼2',
    COLUMN3        VARCHAR(100)                            NULL COMMENT '컬럼3',
    COLUMN4        VARCHAR(100)                            NULL COMMENT '컬럼4',
    COLUMN5        VARCHAR(100)                            NULL COMMENT '컬럼5',
    RAW_DATA       TEXT                                    NULL COMMENT '원시 데이터',
    PROCESS_STATUS VARCHAR(20) DEFAULT 'SUCCESS'           NULL COMMENT '처리 상태(SUCCESS/ERROR)',
    ERROR_MESSAGE  TEXT                                    NULL COMMENT '에러 메시지',
    PROCESS_DTTM   DATETIME    DEFAULT CURRENT_TIMESTAMP() NULL COMMENT '처리 일시',
    REG_DTTM       DATETIME    DEFAULT CURRENT_TIMESTAMP() NULL COMMENT '등록 일시',
    RGTR    VARCHAR(20)                             NULL COMMENT '등록자',
    MDFCN_DTTM       DATETIME    DEFAULT CURRENT_TIMESTAMP() NULL ON UPDATE CURRENT_TIMESTAMP() COMMENT '수정 일시',
    MDFR    VARCHAR(20)                             NULL COMMENT '수정자'
)
    COMMENT '배치파일처리데이터' COLLATE = UTF8MB4_UNICODE_CI;

CREATE INDEX IDX_FILE_NM
    ON TB_BATCH_FILE_DATA (FILE_NM);

CREATE INDEX IDX_PROCESS_DTTM
    ON TB_BATCH_FILE_DATA (PROCESS_DTTM);

CREATE INDEX IDX_PROCESS_STATUS
    ON TB_BATCH_FILE_DATA (PROCESS_STATUS);
