--
--  ダウンロード受注
--      t_dl_order
--

-- DROP TABLE t_dl_order;

CREATE TABLE t_dl_order
(
  orderno           integer NOT NULL,       -- PriKey
  orderrowno        integer NOT NULL,       -- PriKey
  membercd          integer,
  maxdlcount        integer,
  dlperiodend       date,
  
  delflg        boolean,
  adddate       timestamp without time zone,
  upddate       timestamp without time zone,
  updusrnm      varchar(60),
  updpcnm       varchar(60),
  updcnt        integer,
  
  PRIMARY KEY (orderno, orderrowno)
);



-- 
-- トリガ
-- 

-- DROP TRIGGER trigger_master_stamp ON t_dl_order;

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

