Skip to content

Commit 0716af2

Browse files
authored
Merge pull request #213 from TaskFlow-CLAP/CLAP-156
CLAP-156 flyway 설정 적용 및 member 테이블 마이그레이션 작성
2 parents 75dac46 + 97a0206 commit 0716af2

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ALTER TABLE member
2+
DROP
3+
COLUMN notification_enabled;

src/main/resources/mysql.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ spring.config.activate.on-profile: local
2121

2222
spring:
2323
flyway:
24-
enabled: false
24+
enabled: true
2525
baseline-on-migrate: true
26-
locations: classpath:db/migration
26+
locations: classpath:db/migration/dev
2727
jpa:
2828
database: MySQL
2929
open-in-view: false
3030
generate-ddl: false
3131
hibernate:
32-
ddl-auto: update
32+
ddl-auto: none
3333
show-sql: true
3434
properties:
3535
hibernate:
@@ -56,14 +56,14 @@ spring:
5656
open-in-view: false
5757
generate-ddl: false
5858
hibernate:
59-
ddl-auto: update
59+
ddl-auto: validate
6060
show-sql: true
6161
properties:
6262
hibernate:
6363
dialect: org.hibernate.dialect.MySQLDialect
6464

6565
flyway:
66-
enabled: false
66+
enabled: true
6767
baseline-on-migrate: true
6868
locations: classpath:db/migration/dev
6969

src/test/java/clap/server/TaskflowApplicationTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@
77
import org.springframework.boot.test.context.SpringBootTest;
88
import org.springframework.test.context.DynamicPropertyRegistry;
99
import org.springframework.test.context.DynamicPropertySource;
10+
import org.springframework.test.context.TestPropertySource;
1011
import org.testcontainers.elasticsearch.ElasticsearchContainer;
1112
import org.testcontainers.junit.jupiter.Container;
1213
import org.testcontainers.junit.jupiter.Testcontainers;
1314
import org.testcontainers.utility.DockerImageName;
1415

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

17-
//@DataElasticsearchTest
1818
@Testcontainers
1919
@SpringBootTest
20+
@TestPropertySource(properties = "spring.flyway.enabled=false")
2021
class TaskflowApplicationTests {
2122

2223
@Autowired

src/test/java/clap/server/application/service/admin/AddCategoryServiceTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import org.springframework.test.annotation.Rollback;
1313
import org.springframework.test.context.DynamicPropertyRegistry;
1414
import org.springframework.test.context.DynamicPropertySource;
15+
import org.springframework.test.context.TestPropertySource;
1516
import org.testcontainers.elasticsearch.ElasticsearchContainer;
1617
import org.testcontainers.junit.jupiter.Container;
1718
import org.testcontainers.junit.jupiter.Testcontainers;
@@ -21,6 +22,7 @@
2122
@SpringBootTest
2223
@Testcontainers
2324
@Transactional
25+
@TestPropertySource(properties = "spring.flyway.enabled=false")
2426
class AddCategoryServiceTest {
2527

2628
@Container

src/test/resources/application.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ spring:
77
# Database 설정 정보 (H2 연동 정보)
88
datasource:
99
driver-class-name: org.h2.Driver # H2 Database 사용
10-
url: jdbc:h2:mem:testdb # H2 접속 정보
10+
url: jdbc:h2:mem:testdb;DATABASE_TO_UPPER=false # H2 접속 정보
1111
username: taskflow # H2 접속 시 입력할 username 정보
1212
password: # H2 접속 시 입력할 password 정보
1313
jpa:
1414
hibernate:
1515
ddl-auto: create
16+
flyway:
17+
enabled: false
1618

1719
mail:
1820
host: smtp.gmail.com

0 commit comments

Comments
 (0)