--
--  ダウンロード品目
--      t_dl_item
--

-- DROP TABLE t_dl_item;

CREATE TABLE t_dl_item
(
  itemcd            integer NOT NULL,       -- PriKey
  structcd          integer NOT NULL,       -- PriKey
  fileexistence     boolean,
  dlcount           integer,
  dlperioddays      integer,
  "comment"         varchar(1024),
  
  delflg        boolean,
  adddate       timestamp without time zone,
  upddate       timestamp without time zone,
  updusrnm      varchar(60),
  updpcnm       varchar(60),
  updcnt        integer,
  
  PRIMARY KEY (itemcd, structcd)
);



-- 
-- トリガ
-- 

-- DROP TRIGGER trigger_master_stamp ON t_dl_item;

CREATE TRIGGER trigger_master_stamp
  BEFORE INSERT OR UPDATE
  ON t_dl_item
  FOR EACH ROW
  EXECUTE PROCEDURE g_master_stamp();

