Skip to content

Commit

Permalink
Fix: ddl-auto validate 속성으로 변경 (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaewon-pro authored Aug 6, 2024
1 parent 8ae5e64 commit 3654a70
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ public class BadgeAchievementEntity extends BaseTimeEntity {

@NotNull
@ManyToOne(fetch = LAZY)
private MemberEntity memberEntity;
private MemberEntity member;

public static BadgeAchievementEntity from(BadgeAchievement badgeAchievement) {
BadgeAchievementEntity badgeAchievementEntity = new BadgeAchievementEntity();
badgeAchievementEntity.badgeId = badgeAchievement.badge().badgeId();
badgeAchievementEntity.memberEntity = MemberEntity.from(badgeAchievement.member());
badgeAchievementEntity.member = MemberEntity.from(badgeAchievement.member());
return badgeAchievementEntity;
}

public BadgeAchievement toDomain(Badge badge) {
return new BadgeAchievement(badge, memberEntity.toDomain(), getCreatedAt(), getUpdatedAt());
return new BadgeAchievement(badge, member.toDomain(), getCreatedAt(), getUpdatedAt());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class RunningRecordEntity extends BaseTimeEntity {

@NotNull
@ManyToOne(fetch = LAZY)
private MemberEntity memberEntity;
private MemberEntity member;

@NotNull
private Integer distanceMeter;
Expand Down Expand Up @@ -80,7 +80,7 @@ public static RunningRecordEntity from(RunningRecord runningRecord) {

return RunningRecordEntity.builder()
.id(runningRecord.runningId())
.memberEntity(MemberEntity.from(runningRecord.member()))
.member(MemberEntity.from(runningRecord.member()))
.distanceMeter(runningRecord.distanceMeter())
.durationSeconds(runningRecord.durationSeconds())
.calorie(runningRecord.calorie())
Expand All @@ -100,7 +100,7 @@ public RunningRecord toDomain() {

return RunningRecord.builder()
.runningId(id)
.member(memberEntity.toDomain())
.member(member.toDomain())
.distanceMeter(distanceMeter)
.durationSeconds(durationSeconds)
.calorie(calorie)
Expand Down
6 changes: 5 additions & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ spring.profiles.active: local
spring:
jpa:
hibernate:
ddl-auto: none
ddl-auto: validate
show-sql: true
open-in-view: false
defer-datasource-initialization: false
Expand All @@ -15,6 +15,10 @@ spring:
username: ${DATABASE_USER}
password: ${DATABASE_PASSWORD}

flyway:
enabled: true
baseline-on-migrate: true

app:
api:
allow-origins: ${ALLOW_ORIGINS}
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
spring:
jpa:
hibernate:
ddl-auto: none
ddl-auto: validate
show-sql: true
open-in-view: false
defer-datasource-initialization: false
Expand Down

0 comments on commit 3654a70

Please sign in to comment.