14 lines
553 B
SQL
14 lines
553 B
SQL
-- 테이블 생성 SQL - user_table
|
|
CREATE TABLE user_table
|
|
(
|
|
`user_id` INT NOT NULL AUTO_INCREMENT,
|
|
`user_name` VARCHAR(20) NOT NULL,
|
|
`phone_number` VARCHAR(20) NULL,
|
|
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
`updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
|
PRIMARY KEY (user_id)
|
|
);
|
|
|
|
-- Unique Index 설정 SQL - user_table(user_name)
|
|
CREATE UNIQUE INDEX UQ_user_table_1
|
|
ON user_table(user_name); |