--
--  ランキング
--      t_ranking
--

CREATE TABLE t_ranking
(
    RankingCd serial NOT NULL,      -- PriKey
    RankingType integer,
    Date date,
    DataDiv integer,
    RankingRate integer,
    ReferCd 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(RankingCd)
);

-- シリアル初期値
SELECT setval('t_ranking_RankingCd_seq', 10000);


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