--
--  リクエスト
--      t_request
--

CREATE TABLE t_request
(
    RequestNo serial NOT NULL,      -- PriKey
    ItemCd integer,                 -- ForKey
    StructCd integer,               -- ForKey
    RequestMemberCd integer,        -- ForKey
    RequestPrice integer,
    RequestCondition integer,
    StartDate date,
    CloseDate date,
    RequestDiv integer,
    MailInfo 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(RequestNo)
);

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


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