CREATE TABLE account (
no bigint auto_increment primary key,
social varchar(10) not null,
social_id varchar(100) not null,
refresh_token varchar(500) ,
user_no bigint,
unique (social, social_id)
);
fillin_user
CREATE TABLE filiin_user (
no bigint auto_increment primary key,
nickname varchar not null,
profile_image_path varchar(500),
status varchar(10) not null
);
studio
정규화시킬지?
시키게 되면 기존 데이터 보고 어떻게 마이그레이션 할지도 고민해야함
CREATE TABLE studio (
no bigint auto_increment primary key,
name varchar(50) not null,
address varchar (500) ,
tel varchar(50),
latitude double,
longitude double,
etc text,
status varchar(10) not null,
site varchar(500),
);
studio_price
CREATE TABLE price (
no bigint auto_increment primary key,
studio_no bigint not null,
name varchar(100),
amount int,
);
studio_running_time
CREATE TABLE running_time (
no bigint auto_increment primary key,
studio_no bigint not null,
day_of_week enum('MON', 'TUE', 'WED', 'THR', 'FRI', 'SAT', 'SUN') not null,
start_at datetime,
end_at datetime
);
film
CREATE TABLE film (
no bigint auto_increment primary key,
name varchar(100) not null,
type_no bigint not null,
company_no bigint not null
);
CREATE TABLE film_type (
no bigint auto_increment primary key,
name varchar(50) not null
);
company
CREATE TABLE company (
no bigint auto_increment primary key,
name varchar(50) not null
);
photo
meta data 는 추후에 필요시 테이블 확장
like count 는 Redis 로 확장
CREATE TABLE photo (
no bigint auto_increment primary key,
user_no bigint not null,
studio_no bigint not null,
film_no bigint not null,
image_path varchar(500) not null,
status varchar(10) not null,
created_at datetime,
update_at datetime
);
reaction_history
CREATE TABLE reaction_history (
no bigint auto_increment primary key,
user_no bigint not null,
target_type varchar(50) not null,
target_no bigint not null,
created_at datetime
unique (user_no, target_type, target_no)
);
account
fillin_user
studio
studio_price
studio_running_time
film
company
photo
reaction_history