Info
- Mysql μ¬μ©
- ν μ΄λΈκ°μ μμ‘΄μ±μ μ΅λν μ€μ (serviceμμ νμμ λ°λΌ μμ λ‘κ² μμ‘΄μ±μ κ°μ§ μ μλλ‘)
Tables
Member
create table member
(
id bigint primary key auto_increment comment 'SEQ',
username varchar(100) unique not null comment 'νμ EMAIL (μνΈν)',
password varchar(500) not null comment 'νμ PWD (μνΈν)',
name varchar(100) not null comment 'νμ μ΄λ¦ (μνΈν)',
phone_number varchar(100) not null comment 'νμ μ νλ²νΈ (μνΈν)',
image_url varchar(100) null comment 'νλ‘ν μ΄λ―Έμ§ URL',
created_at datetime not null default now() comment 'μμ±μΌ',
updated_at datetime not null default now() comment 'μμ μΌ'
) comment 'νμ ν
μ΄λΈ';Schedule
create table schedule
(
id bigint primary key auto_increment comment 'SEQ',
type varchar(10) not null comment 'μ€μΌμ₯΄ νμ
(TIME/TASK)',
title varchar(100) not null comment 'μ€μΌμ₯΄ νμ΄ν',
contents varchar(1000) not null comment 'μ€μΌμ₯΄ μμΈ',
is_important int(1) not null default 0 comment 'μ€μΌμ₯΄ μ€μ μ¬λΆ',
created_at datetime not null default now() comment 'μμ±μΌ',
updated_at datetime not null default now() comment 'μμ μΌ'
) comment 'μ€μΌμ₯΄ ν
μ΄λΈ'ScheduleDate
- schedule μκ° ν μ΄λΈμ λ°λ‘ λΆλ¦¬ν¨
- scheduleκ³Ό 1:1 λ§€ν
- κ²μμ μ©μ΄νλλ‘ λ /μ/μΌ/μ/λΆ μΌλ‘ columnμ λλ
- μμμΌμλ₯Ό κΈ°μ€μΌλ‘ κ²μμ μ©μ΄νκ² index μ€μ
CREATE TABLE scheduleDate(
id bigint primary key comment 'SEQ (schedule 1:1)',
start_year int not null comment 'μμ λ
λ',
start_month int not null comment 'μμ μ',
start_day int not null comment 'μμ μΌ',
start_hour int null comment 'μμ μκ°',
start_minute int null comment 'μμ λΆ',
started_at datetime comment 'μμ μΌμ (full time)',
end_year int not null comment 'μ’
λ£ λ
λ',
end_month int not null comment 'μ’
λ£ μ',
end_day int not null comment 'μ’
λ£ μΌ',
end_hour int null comment 'μ’
λ£ μκ°',
end_minute int null comment 'μ’
λ£ λΆ',
ended_at datetime comment 'μ’
λ£ μΌμ (full time)'
) comment 'μ€μΌμ₯΄ μκ° ν
μ΄λΈ (μ€μΌμ₯΄κ³Ό 1:1 λ§€ν)'
CREATE INDEX idx_scheduleDate_start_year ON scheduleDate(start_year);
CREATE INDEX idx_scheduleDate_start_month ON scheduleDate(start_month);
CREATE INDEX idx_scheduleDate_start_day ON scheduleDate(start_day);
CREATE INDEX idx_scheduleDate_start_hour ON scheduleDate(start_hour);
CREATE INDEX idx_scheduleDate_start_minute ON scheduleDate(start_minute);Holiday
create table holiday
(
year int not null comment 'ν΄μΌ λ
λ',
month int not null comment 'ν΄μΌ μ',
day int not null comment 'ν΄μΌ μΌ',
title varchar(100) not null comment 'ν΄μΌ νμ΄ν',
unique key (year, month, day)
) comment 'ν΄μΌ ν
μ΄λΈ';