--
--  仮会員
--      t_trial_member
--

-- DROP TABLE t_trial_member;

CREATE TABLE t_trial_member
(
    sessionid       integer                 NOT NULL,       -- PriKey
    memberdiv       integer                 NOT NULL,
    lastnm          character varying(256)  NOT NULL,
    firstnm         character varying(256)  NOT NULL,
    lastnmkana      character varying(256)  NOT NULL,
    firstnmkana     character varying(256)  NOT NULL,
    mailaddr        character varying(256)  NOT NULL UNIQUE,
    mobmailaddr     character varying(256),
    password        character varying(256)  NOT NULL,
    nicknm          character varying(256),
    secquestioncd   integer                 NOT NULL,       -- ForKey
    secquestionans  character varying(256)  NOT NULL,
    birthdate       date,
    sex             integer                 NOT NULL,
    selfintro       character varying(1024),
    memberstate     integer,
    maildiv         integer,
    registdate      date                    NOT NULL,

    delflg          boolean,
    adddate         timestamp without time zone,
    upddate         timestamp without time zone,
    updusrnm        character varying(60),
    updpcnm         character varying(60),
    updcnt          integer,

    PRIMARY KEY(sessionid)
);


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