--
--  アクセス数
--      t_access
--

CREATE TABLE t_access
(
    ItemCd integer,               -- PriKey
    AccessDate date,              -- PriKey
    ReferCount integer,

    DelFlg boolean,
    AddDate timestamp without time zone,
    UpdDate timestamp without time zone,
    UpdUsrNm character varying(60),
    UpdPcNm character varying(60),
    UpdCnt integer,

    PRIMARY KEY(ItemCd,AccessDate)
);


-- トリガー
CREATE TRIGGER trigger_master_stamp
  BEFORE INSERT OR UPDATE
  ON t_access
  FOR EACH ROW
  EXECUTE PROCEDURE g_master_stamp();