Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix: killing_part like_count 디폴트값 추가 #339

Merged
merged 5 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/src/main/resources/dev/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ create table if not exists killing_part
start_second integer not null,
length varchar(255) not null check (length in ('SHORT', 'STANDARD', 'LONG')),
song_id bigint not null,
like_count integer not null,
like_count integer not null default 0,
created_at timestamp(6) not null,
primary key (id)
);
Expand Down
1 change: 1 addition & 0 deletions backend/src/main/resources/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,4 @@ alter table killing_part add column like_count integer not null;
alter table killing_part_comment add column member_id bigint not null;
alter table song change video_url video_id varchar(20) not null;
alter table voting_song change video_url video_id varchar(20) not null;
alter table killing_part alter column like_count set default 0;
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static org.assertj.core.api.Assertions.assertThat;

import io.jsonwebtoken.Claims;
import io.restassured.RestAssured;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
Expand Down Expand Up @@ -63,11 +64,9 @@ void success_reissue_accessToken() {
.extract().body().as(ReissueAccessTokenResponse.class);

//then
final String accessToken = tokenProvider.createAccessToken(
savedMember.getId(),
savedMember.getNickname());

assertThat(response.getAccessToken()).isEqualTo(accessToken);
final Claims claims = tokenProvider.parseClaims(response.getAccessToken());
assertThat(claims.get("memberId", Long.class)).isEqualTo(savedMember.getId());
assertThat(claims.get("nickname", String.class)).isEqualTo(savedMember.getNickname());
}

@DisplayName("refreshToken이 없이 accessToken을 재발급 받으려면 예외를 던잔디.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ create table if not exists killing_part
start_second integer not null,
length varchar(255) not null check (length in ('SHORT', 'STANDARD', 'LONG')),
song_id bigint not null,
like_count integer not null,
like_count integer not null default 0,
created_at timestamp(6) not null,
primary key (id)
);
Expand Down
2 changes: 1 addition & 1 deletion backend/src/test/resources/schema-test.sql
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ create table if not exists killing_part
start_second integer not null,
length varchar(255) not null check (length in ('SHORT', 'STANDARD', 'LONG')),
song_id bigint not null,
like_count integer not null,
like_count integer not null default 0,
created_at timestamp(6) not null,
primary key (id)
);
Expand Down