Info

  • Mysql μ‚¬μš©
  • ν…Œμ΄λΈ”κ°„μ˜ μ˜μ‘΄μ„±μ„ μ΅œλŒ€ν•œ μ€„μž„ (serviceμ—μ„œ ν•„μš”μ— 따라 자유둭게 μ˜μ‘΄μ„±μ„ κ°€μ§ˆ 수 μžˆλ„λ‘)

Tables

Member

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

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 μ„€μ •
scheduleDate
 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

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 '휴일 ν…Œμ΄λΈ”';