--
--  購入者属性
--      t_consumer_attr
--

CREATE TABLE t_consumer_attr
(
    MemberCd integer NOT NULL,          -- PriKey
    PostalCd character varying(10),
    PrefCd integer,                     -- ForKey
    Addr1 character varying(256),
    Addr2 character varying(256),
    Telno1 character varying(20),
    Telno2 character varying(20),
    SendPostalCd character varying(10),
    SendPrefCd integer,                 -- ForKey
    SendAddr1 character varying(256),
    SendAddr2 character varying(256),
    SendTelno1 character varying(20),
    Addressee character varying(256),

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

    PRIMARY KEY(MemberCd)
);


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