drop table if exists fs_job CASCADE;
drop table if exists tb_input_data CASCADE;
drop table if exists tb_input CASCADE;




/* ==================================================================================================================
   FS_JOB
================================================================================================================== */
-- auto-generated definition
create table fs_job
(
    job_cd          varchar2(10)            not null
        constraint pk_fs_job
        primary key,
    job_name        varchar2(100),
    job_desc        varchar2(500),
    enc_phone_no_yn varchar2(1) default 'n' not null,
    enc_name_yn     varchar2(1) default 'n' not null,
    enc_birthday_yn varchar2(1) default 'n' not null,
    unsube_use_yn   varchar2(1) default 'n',
    unsube_type     varchar2(20),
    use_yn          varchar2(1) default 'y' not null,
    reg_id          varchar2(20),
    reg_dt          date,
    upd_id          varchar2(20),
    upd_dt          date,
    org_cd          varchar2(100),
    call_center_no  varchar2(20),
    redirect_url    varchar2(500),
    template_cd     varchar2(100)
)
    /

comment on table fs_job is '작업 테이블'
/

comment on column fs_job.job_cd is '작업코드'
/

comment on column fs_job.job_name is '작업명'
/

comment on column fs_job.job_desc is '작업설명'
/

comment on column fs_job.enc_phone_no_yn is '암호화휴대폰번호여부'
/

comment on column fs_job.enc_name_yn is '암호화성명여부'
/

comment on column fs_job.enc_birthday_yn is '암호화생년월일여부'
/

comment on column fs_job.unsube_use_yn is '수신거부적용여부'
/

comment on column fs_job.unsube_type is '수신거부구분'
/

comment on column fs_job.use_yn is '사용여부'
/

comment on column fs_job.reg_id is '등록자'
/

comment on column fs_job.reg_dt is '등록일시'
/

comment on column fs_job.upd_id is '수정자'
/

comment on column fs_job.upd_dt is '수정일시'
/

comment on column fs_job.org_cd is '기관코드'
/

comment on column fs_job.call_center_no is '콜센터전화번호'
/

comment on column fs_job.redirect_url is 'redirect url'
/

comment on column fs_job.template_cd is '나이스템플릿코드'
/





/* ==================================================================================================================
   TB_INPUT
================================================================================================================== */
-- auto-generated definition
create table tb_input
(
    lnk_input_id   bigint       not null
        primary key,
    err_msg        varchar(255) null,
    expires_dt     datetime(6)  not null,
    org_cd         varchar(255) not null,
    pay_expires_dt datetime(6)  not null,
    prcs_cd        varchar(255) not null,
    rcpt_dt        varchar(255) null,
    reg_dt         datetime(6)  not null,
    reg_id         varchar(255) not null,
    run_dt         datetime(6)  not null,
    send_type      varchar(255) not null,
    tot_cnt        bigint       not null,
    upd_dt         datetime(6)  null,
    upd_id         varchar(255) null,
    job_cd         varchar(255) null,
    constraint FKcm5oqpuk5ei0dcq4t4msm452
        foreign key (job_cd) references fs_job (job_cd)
);



/* ==================================================================================================================
   TB_INPUT_DATA
================================================================================================================== */
-- auto-generated definition
create table tb_input_data
(
    data_id       varchar(255) not null
        primary key,
    birthday      varchar(255) null,
    car_no        varchar(255) null,
    gender        varchar(255) null,
    msg_data      varchar(255) null,
    msg_dtl_data  varchar(255) null,
    name          varchar(255) null,
    pay_status_cd varchar(255) null,
    pay_url       varchar(255) null,
    reg_dt        date         not null,
    reg_id        varchar(255) not null,
    sid           varchar(255) null,
    upd_dt        date         null,
    upd_id        varchar(255) null,
    lnk_input_id  bigint       null,
    constraint FKpqe2cfvqlqow56y6f0lv9v1ue
        foreign key (lnk_input_id) references tb_input (lnk_input_id)
);

