--
--  ジャンル
--      t_genre
--

CREATE TABLE t_genre
(
    genrecd         serial NOT NULL,            -- PriKey
    genrenm         character varying(256),
    disppriority    integer,
    parentcd        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(genrecd)
);

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


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