--
--  キャスト
--      t_cast
--

CREATE TABLE t_cast
(
    CastCd serial NOT NULL,             -- PriKey
    CastNm character varying(256),
    CastNmKana character varying(256),
    CastDiv integer,                    -- ForKey
    RecommendDiv integer,
    Comment character varying(1024),
    DebutDate character varying(256),
    BirthplaceCd integer,               -- ForKey
    BirthDate character varying(256),
    ShopDiv 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(CastCd)
);

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

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