Skip to content

Commit

Permalink
fix: ddl 타입 변경 및 더미데이터 추가는 배포서버 재부팅때만 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
GitJIHO committed Nov 6, 2024
1 parent ac992c0 commit 274cfa2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/testcode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ jobs:
SPRING_DATASOURCE_URL: ${{ secrets.MYSQL_URL }}
SPRING_DATASOURCE_USERNAME: ${{ secrets.MYSQL_USERNAME }}
SPRING_DATASOURCE_PASSWORD: ${{ secrets.MYSQL_PASSWORD }}
SPRING_JPA_HIBERNATE_DDL_AUTO: "create"
SPRING_JPA_HIBERNATE_DDL_AUTO: "update"
JWT_SECRET: ${{ secrets.JWT_SECRET }}
run: ./gradlew test
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.example.sinitto.sinitto.entity.SinittoBankInfo;
import com.example.sinitto.sinitto.repository.SinittoBankInfoRepository;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
Expand All @@ -34,6 +35,7 @@
import java.time.LocalTime;

@Component
@Profile("prod")
public class InitialData implements CommandLineRunner {

private final MemberRepository memberRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.transaction.annotation.Transactional;

import static org.hibernate.validator.internal.util.Contracts.assertNotNull;

@SpringBootTest
@Transactional
class SinittoApplicationTests {

@Value("${jwt.secret}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void testExistByMemberId() {
boolean check1 = sinittoBankInfoRepository.existsByMemberId(member.getId());
assertTrue(check1);

boolean check2 = sinittoBankInfoRepository.existsByMemberId(2L);
boolean check2 = sinittoBankInfoRepository.existsByMemberId(0L);
assertFalse(check2);
}
}

0 comments on commit 274cfa2

Please sign in to comment.