-
Notifications
You must be signed in to change notification settings - Fork 1
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
fix/feat: flyway V5 DML이 적용되지 않는 문제 해결 + 테스트 컨테이너 적용 #729
Changes from 18 commits
8c438e1
c57e32d
06fe165
c3a9fc3
338dad1
0679e5e
14dfea0
f89c094
6131e97
7270bd8
54f53db
b871c2d
671b5f0
7081022
2b445eb
06c488f
ad794e6
16acd52
635a173
c9cc986
ba34a94
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,80 @@ | ||
plugins { | ||
id 'java' | ||
id 'jacoco' //테스트 커버리지 검증 라이브러리 추가 | ||
id 'org.springframework.boot' version '3.3.1' | ||
id 'io.spring.dependency-management' version '1.1.5' | ||
id 'java' | ||
id 'jacoco' //테스트 커버리지 검증 라이브러리 추가 | ||
id 'org.springframework.boot' version '3.3.1' | ||
id 'io.spring.dependency-management' version '1.1.5' | ||
id 'com.palantir.docker-compose' version '0.36.0' | ||
} | ||
|
||
group = 'com.ody' | ||
version = '0.0.1-SNAPSHOT' | ||
|
||
java { | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(17) | ||
} | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(17) | ||
} | ||
} | ||
|
||
dockerCompose { | ||
dockerComposeFile 'docker-compose-local.yml' | ||
} | ||
|
||
jacoco { | ||
toolVersion = '0.8.8' | ||
toolVersion = '0.8.8' | ||
} | ||
|
||
jacocoTestReport { | ||
jacocoTestReport { | ||
reports { | ||
xml.required.set(true) | ||
csv.required.set(false) | ||
html.required.set(true) | ||
} | ||
} | ||
reports { | ||
xml.required.set(true) | ||
csv.required.set(false) | ||
html.required.set(true) | ||
} | ||
} | ||
|
||
configurations { | ||
compileOnly { | ||
extendsFrom annotationProcessor | ||
} | ||
compileOnly { | ||
extendsFrom annotationProcessor | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation 'com.google.firebase:firebase-admin:9.2.0' | ||
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.5.0' | ||
implementation 'com.github.ulisesbocchio:jasypt-spring-boot-starter:3.0.5' | ||
implementation 'org.springframework.boot:spring-boot-starter' | ||
implementation 'org.springframework.boot:spring-boot-starter-web' | ||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa' | ||
implementation 'org.springframework.boot:spring-boot-starter-validation' | ||
implementation "io.jsonwebtoken:jjwt:0.9.1" | ||
implementation 'javax.xml.bind:jaxb-api:2.3.1' | ||
implementation 'org.springframework.boot:spring-boot-starter-actuator' | ||
|
||
runtimeOnly 'com.mysql:mysql-connector-j:8.4.0' | ||
runtimeOnly 'com.h2database:h2' | ||
implementation 'com.google.firebase:firebase-admin:9.2.0' | ||
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.5.0' | ||
implementation 'com.github.ulisesbocchio:jasypt-spring-boot-starter:3.0.5' | ||
implementation 'org.springframework.boot:spring-boot-starter' | ||
implementation 'org.springframework.boot:spring-boot-starter-web' | ||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa' | ||
implementation 'org.springframework.boot:spring-boot-starter-validation' | ||
implementation "io.jsonwebtoken:jjwt:0.9.1" | ||
implementation 'javax.xml.bind:jaxb-api:2.3.1' | ||
implementation 'org.springframework.boot:spring-boot-starter-actuator' | ||
implementation 'org.flywaydb:flyway-mysql' | ||
implementation 'org.flywaydb:flyway-core' | ||
implementation 'org.testcontainers:testcontainers-bom:1.20.2' | ||
|
||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
testImplementation 'io.rest-assured:rest-assured:5.3.1' | ||
runtimeOnly 'com.mysql:mysql-connector-j:8.4.0' | ||
|
||
testRuntimeOnly 'org.junit.platform:junit-platform-launcher' | ||
testRuntimeOnly 'com.h2database:h2' | ||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
testImplementation 'io.rest-assured:rest-assured:5.3.1' | ||
testImplementation "org.testcontainers:junit-jupiter" | ||
testImplementation 'org.testcontainers:mysql' | ||
|
||
annotationProcessor 'org.projectlombok:lombok' | ||
compileOnly 'org.projectlombok:lombok' | ||
testRuntimeOnly 'org.junit.platform:junit-platform-launcher' | ||
testRuntimeOnly 'com.h2database:h2' | ||
|
||
implementation 'org.flywaydb:flyway-mysql' | ||
implementation 'org.flywaydb:flyway-core' | ||
annotationProcessor 'org.projectlombok:lombok' | ||
compileOnly 'org.projectlombok:lombok' | ||
} | ||
|
||
tasks.named('test') { | ||
useJUnitPlatform() | ||
finalizedBy jacocoTestReport | ||
useJUnitPlatform() | ||
finalizedBy jacocoTestReport | ||
} | ||
|
||
configurations.all { | ||
exclude group: 'commons-logging', module: 'commons-logging' | ||
exclude group: 'commons-logging', module: 'commons-logging' | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
services: | ||
db: | ||
image: mysql:8.0.35 | ||
container_name: mysql-local-db | ||
restart: always | ||
ports: | ||
- "53306:3306" | ||
environment: | ||
MYSQL_ROOT_HOST: '%' | ||
MYSQL_ROOT_PASSWORD: 1234 | ||
MYSQL_DATABASE: ody | ||
TZ: Asia/seoul |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
ALTER TABLE notification ADD CONSTRAINT notification_chk_1 CHECK (notification.type IN ('DEPARTURE_REMINDER', 'ENTRY', 'NUDGE', 'MEMBER_DELETION', 'ETA_NOTICE')); | ||
ALTER TABLE notification DROP CONSTRAINT notification_chk_1; | ||
|
||
ALTER TABLE notification ADD CONSTRAINT notification_chk_1 CHECK (`type` IN ('DEPARTURE_REMINDER', 'ENTRY', 'NUDGE', 'MEMBER_DELETION', 'ETA_NOTICE')); | ||
Comment on lines
+1
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [질문] drop 후 다시 add 해주는 이유가 궁금해요! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. v1 스키마가 실행될 때 type에 대한 제약조건 기존에 문제가 되지 않았던 이유는 dev, prod db에 접근해서 제약조건을 임의로 제거했기 때문이였어요 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/*! ALTER DATABASE ody CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci; */ | ||
/*! ALTER TABLE member CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; */ | ||
/*! ALTER TABLE meeting CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; */ | ||
/*! ALTER TABLE mate CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; */ | ||
/*! ALTER TABLE notification CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; */ | ||
/*! ALTER TABLE eta CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; */ | ||
ALTER DATABASE ody CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci; | ||
ALTER TABLE member CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
ALTER TABLE meeting CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
ALTER TABLE mate CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
ALTER TABLE notification CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
ALTER TABLE eta CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
/*! ALTER TABLE member MODIFY COLUMN deleted_at timestamp(6); */ | ||
/*! ALTER TABLE meeting MODIFY COLUMN created_at timestamp(6); */ | ||
/*! ALTER TABLE meeting MODIFY COLUMN updated_at timestamp(6); */ | ||
/*! ALTER TABLE mate MODIFY COLUMN deleted_at timestamp(6); */ | ||
/*! ALTER TABLE eta CHANGE COLUMN created_at first_api_call_at timestamp not null; */ | ||
/*! ALTER TABLE eta CHANGE COLUMN updated_at last_api_call_at timestamp not null; */ | ||
/*! ALTER TABLE eta MODIFY COLUMN deleted_at timestamp(6); */ | ||
/*! ALTER TABLE notification MODIFY COLUMN send_at timestamp(6); */ | ||
/*! ALTER TABLE notification MODIFY COLUMN created_at timestamp(6); */ | ||
/*! ALTER TABLE notification MODIFY COLUMN updated_at timestamp(6); */ | ||
ALTER TABLE member MODIFY COLUMN deleted_at timestamp(6); | ||
ALTER TABLE meeting MODIFY COLUMN created_at timestamp(6); | ||
ALTER TABLE meeting MODIFY COLUMN updated_at timestamp(6); | ||
ALTER TABLE mate MODIFY COLUMN deleted_at timestamp(6); | ||
ALTER TABLE eta CHANGE COLUMN created_at first_api_call_at timestamp not null; | ||
ALTER TABLE eta CHANGE COLUMN updated_at last_api_call_at timestamp not null; | ||
ALTER TABLE eta MODIFY COLUMN deleted_at timestamp(6); | ||
ALTER TABLE notification MODIFY COLUMN send_at timestamp(6); | ||
ALTER TABLE notification MODIFY COLUMN created_at timestamp(6); | ||
ALTER TABLE notification MODIFY COLUMN updated_at timestamp(6); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[질문]
사용을 안 하고 있는것 같은데 맞을까요? 제거부탁드려요~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
모든 job들에 타임존 설정이 적용되고 있어서
시간 계산 로직으로 인한 사이드 이펙트 방지로 들어가면 좋을꺼같아요 !