--
--  検索キーワード
--      t_search_key
--

CREATE TABLE t_search_key
(
    SearchKeyCd serial NOT NULL,        -- PriKey
    ItemCd integer,                     -- ForKey
    UserCd integer,                     -- ForKey
    SearchKey character varying(256),
    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(SearchKeyCd)
);

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


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