--
--  レビュー
--      t_review
--

CREATE TABLE t_review
(
    ReviewCd serial NOT NULL,       -- PriKey
    ItemCd integer,                 -- ForKey
    UserCd integer,                 -- ForKey
    RankingRate integer,
    Comment character varying(1024),
    CreateDate timestamp without time zone,

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

    PRIMARY KEY(ReviewCd)
);

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


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