Skip to content

Commit

Permalink
config: schema에서 legacy_length 열 삭제 (#522)
Browse files Browse the repository at this point in the history
  • Loading branch information
seokhwan-an authored Oct 19, 2023
1 parent 622afd4 commit f771946
Showing 1 changed file with 5 additions and 22 deletions.
27 changes: 5 additions & 22 deletions backend/src/main/resources/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ create table if not exists song

create table if not exists killing_part
(
id bigint auto_increment,
start_second integer not null,
legacy_length varchar(255) not null check (legacy_length in ('SHORT', 'STANDARD', 'LONG')),
length integer not null,
song_id bigint not null,
created_at timestamp(6) not null,
id bigint auto_increment,
start_second integer not null,
length integer not null,
song_id bigint not null,
created_at timestamp(6) not null,
primary key (id)
);

Expand Down Expand Up @@ -106,19 +105,3 @@ alter table song
'FOLK_BLUES', 'POP', 'JAZZ', 'CLASSIC', 'J_POP', 'EDM', 'ETC'));
alter table vote
add column member_id bigint not null;
/* 배포 시 임시 열을 추가한 뒤에, rename 한다.
alter table killing_part
add column temp_length integer;
update killing_part
set temp_length = CASE
WHEN length = 'SHORT' THEN 5
WHEN length = 'STANDARD' THEN 10
WHEN length = 'LONG' THEN 15
END;
alter table killing_part
modify temp_length integer not null;
alter table killing_part
change column length legacy_length varchar(255) null;
alter table killing_part
change column temp_length length integer not null;
*/

0 comments on commit f771946

Please sign in to comment.