diff --git a/backend/src/main/resources/dev/schema.sql b/backend/src/main/resources/dev/schema.sql index bc5a90a27..5562b9f88 100644 --- a/backend/src/main/resources/dev/schema.sql +++ b/backend/src/main/resources/dev/schema.sql @@ -14,7 +14,7 @@ create table if not exists song length integer not null, video_id varchar(20) not null, album_cover_url text not null, - genre varchar(20), + genre varchar(255) check (genre in ('BALLAD', 'DANCE', 'HIPHOP', 'RHYTHM_AND_BLUES', 'INDIE', 'ROCK_METAL', 'TROT', 'FOLK_BLUES', 'POP', 'JAZZ', 'CLASSIC', 'J_POP', 'EDM', 'ETC')), created_at timestamp(6) not null, primary key (id) ); diff --git a/backend/src/main/resources/schema.sql b/backend/src/main/resources/schema.sql index 0841c17b0..3ef6d1b1d 100644 --- a/backend/src/main/resources/schema.sql +++ b/backend/src/main/resources/schema.sql @@ -88,4 +88,5 @@ alter table killing_part alter column like_count set default 0; alter table member add column created_at timestamp(6) not null; -alter table song add column genre varchar(20); +alter table song add column genre varchar(255) check + (genre in ('BALLAD', 'DANCE', 'HIPHOP', 'RHYTHM_AND_BLUES', 'INDIE', 'ROCK_METAL', 'TROT', 'FOLK_BLUES', 'POP', 'JAZZ', 'CLASSIC', 'J_POP', 'EDM', 'ETC')); diff --git a/backend/src/test/resources/killingpart/initialize_killing_part_song.sql b/backend/src/test/resources/killingpart/initialize_killing_part_song.sql index 3310c53b9..f263d7685 100644 --- a/backend/src/test/resources/killingpart/initialize_killing_part_song.sql +++ b/backend/src/test/resources/killingpart/initialize_killing_part_song.sql @@ -12,7 +12,7 @@ create table if not exists song length integer not null, video_id varchar(20) not null, album_cover_url text not null, - genre varchar(20), + genre varchar(255) check (genre in ('BALLAD', 'DANCE', 'HIPHOP', 'RHYTHM_AND_BLUES', 'INDIE', 'ROCK_METAL', 'TROT', 'FOLK_BLUES', 'POP', 'JAZZ', 'CLASSIC', 'J_POP', 'EDM', 'ETC')), created_at timestamp(6) not null, primary key (id) ); diff --git a/backend/src/test/resources/schema-test.sql b/backend/src/test/resources/schema-test.sql index c9c133402..2d4405534 100644 --- a/backend/src/test/resources/schema-test.sql +++ b/backend/src/test/resources/schema-test.sql @@ -15,7 +15,7 @@ create table if not exists song length integer not null, video_id varchar(20) not null, album_cover_url text not null, - genre varchar(20), + genre varchar(255) check (genre in ('BALLAD', 'DANCE', 'HIPHOP', 'RHYTHM_AND_BLUES', 'INDIE', 'ROCK_METAL', 'TROT', 'FOLK_BLUES', 'POP', 'JAZZ', 'CLASSIC', 'J_POP', 'EDM', 'ETC')), created_at timestamp(6) not null, primary key (id) );