-- std_snp_data.tb_ship_risk_detail_info definition

-- Drop table

-- DROP TABLE std_snp_data.tb_ship_risk_detail_info;

CREATE TABLE std_snp_data.tb_ship_risk_detail_info (
    row_index bigserial NOT NULL,
    crt_dt timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL,
    creatr_id varchar(34) NOT NULL,
    mdfcn_dt timestamp NULL,
    mdfr_id varchar(34) NULL,
    job_execution_id int8 NOT NULL,
    imo_no varchar(20) NULL,
    last_mdfcn_dt timestamptz NULL,
    risk_data_maint int4 NULL,
    ais_notrcv_elps_days int4 NULL,
    ais_notrcv_elps_days_desc varchar(500) NULL,
    ais_lwrnk_days int4 NULL,
    ais_lwrnk_days_desc varchar(500) NULL,
    ais_up_imo_desc int4 NULL,
    ais_up_imo_desc_val varchar(500) NULL,
    othr_ship_nm_voy_yn int4 NULL,
    othr_ship_nm_voy_yn_desc varchar(500) NULL,
    mmsi_anom_message int4 NULL,
    mmsi_anom_message_desc varchar(500) NULL,
    recent_dark_actv int4 NULL,
    recent_dark_actv_desc varchar(500) NULL,
    port_prtcll int4 NULL,
    port_prtcll_desc varchar(500) NULL,
    port_risk int4 NULL,
    port_risk_desc varchar(500) NULL,
    sts_job int4 NULL,
    sts_job_desc varchar(500) NULL,
    drift_chg int4 NULL,
    drift_chg_desc varchar(500) NULL,
    risk_event int4 NULL,
    risk_event_desc varchar(500) NULL,
    risk_event_desc_ext varchar(500) NULL,
    ntnlty_chg int4 NULL,
    ntnlty_chg_desc varchar(500) NULL,
    ntnlty_prs_mou_perf int4 NULL,
    ntnlty_prs_mou_perf_desc varchar(500) NULL,
    ntnlty_tky_mou_perf int4 NULL,
    ntnlty_tky_mou_perf_desc varchar(500) NULL,
    ntnlty_uscg_mou_perf int4 NULL,
    ntnlty_uscg_mou_perf_desc varchar(500) NULL,
    uscg_excl_ship_cert int4 NULL,
    uscg_excl_ship_cert_desc varchar(500) NULL,
    psc_inspection_elps_hr int4 NULL,
    psc_inspection_elps_hr_desc varchar(500) NULL,
    psc_inspection int4 NULL,
    psc_inspection_desc varchar(500) NULL,
    psc_defect int4 NULL,
    psc_defect_desc varchar(500) NULL,
    psc_detained int4 NULL,
    psc_detained_desc varchar(500) NULL,
    now_smgrc_evdc int4 NULL,
    now_smgrc_evdc_desc varchar(500) NULL,
    docc_chg int4 NULL,
    docc_chg_desc varchar(500) NULL,
    now_clfic int4 NULL,
    now_clfic_desc varchar(500) NULL,
    now_clfic_desc_ext varchar(500) NULL,
    clfic_status_chg int4 NULL,
    clfic_status_chg_desc varchar(500) NULL,
    pni_insrnc int4 NULL,
    pni_insrnc_desc varchar(500) NULL,
    pni_insrnc_desc_ext varchar(500) NULL,
    ship_nm_chg int4 NULL,
    ship_nm_chg_desc varchar(500) NULL,
    gbo_chg int4 NULL,
    gbo_chg_desc varchar(500) NULL,
    vslage int4 NULL,
    vslage_desc varchar(500) NULL,
    ilgl_fshr_viol int4 NULL,
    ilgl_fshr_viol_desc varchar(500) NULL,
    draft_chg int4 NULL,
    draft_chg_desc varchar(500) NULL,
    recent_sanction_prtcll int4 NULL,
    recent_sanction_prtcll_desc varchar(500) NULL,
    sngl_ship_voy int4 NULL,
    sngl_ship_voy_desc varchar(500) NULL,
    fltsfty int4 NULL,
    fltsfty_desc varchar(500) NULL,
    flt_psc int4 NULL,
    flt_psc_desc varchar(500) NULL,
    spc_inspection_ovdue int4 NULL,
    spc_inspection_ovdue_desc varchar(500) NULL,
    ownr_unk int4 NULL,
    ownr_unk_desc varchar(500) NULL,
    rss_port_call int4 NULL,
    rss_port_call_desc varchar(500) NULL,
    rss_ownr_reg int4 NULL,
    rss_ownr_reg_desc varchar(500) NULL,
    rss_sts int4 NULL,
    rss_sts_desc varchar(500) NULL
);
COMMENT ON TABLE std_snp_data.tb_ship_risk_detail_info IS 'Risk 상세 데이터 (RisksByImos API)';

ALTER TABLE std_snp_data.tb_ship_risk_detail_info OWNER TO snp;
GRANT SELECT, UPDATE, TRUNCATE, TRIGGER, INSERT, DELETE, REFERENCES ON TABLE std_snp_data.tb_ship_risk_detail_info TO snp;
