■ 테이블 생성시 UNIQUE 제약 조건 추가하기

------------------------------------------------------------------------------------------------------------------------

 

CREATE TABLE IF NOT EXISTS com_user

(

    id               char(36)    NOT NULL PRIMARY KEY

   ,type             char(1)     NOT NULL

   ,name             varchar(50) NOT NULL

   ,user_id          varchar(20) NOT NULL UNIQUE

   ,password         varchar(20) NOT NULL

   ,member_grade     char(2)     NOT NULL

   ,limit_age        char(2)     NOT NULL

   ,mail_address     varchar(50) NOT NULL

   ,mobile_phone     varchar(14) NULL

   ,menu_template_id char(36)    NULL

   ,status_code      char(1)     NOT NULL

   ,description      varchar     NULL

   ,create_id        char(36)    NOT NULL

   ,create_time      timestamp   NOT NULL

   ,update_id        char(36)    NOT NULL

   ,update_time      timestamp   NOT NULL

);

 

------------------------------------------------------------------------------------------------------------------------

Posted by 사용자 icodebroker
TAG