--
--  通知メール、定型文
--      t_mailtemplate
--

CREATE TABLE t_mailtemplate
(
    MailtplCd serial NOT NULL,     -- PriKey
    template character varying(256),
    Title character varying(256),
    Body text,

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

    PRIMARY KEY(MailtplCd)
);

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


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