diff --git a/src/main/java/com/dnd/runus/infrastructure/persistence/jpa/badge/entity/BadgeAchievementEntity.java b/src/main/java/com/dnd/runus/infrastructure/persistence/jpa/badge/entity/BadgeAchievementEntity.java index ef7476cd..f2d49b58 100644 --- a/src/main/java/com/dnd/runus/infrastructure/persistence/jpa/badge/entity/BadgeAchievementEntity.java +++ b/src/main/java/com/dnd/runus/infrastructure/persistence/jpa/badge/entity/BadgeAchievementEntity.java @@ -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()); } } diff --git a/src/main/java/com/dnd/runus/infrastructure/persistence/jpa/running/entity/RunningRecordEntity.java b/src/main/java/com/dnd/runus/infrastructure/persistence/jpa/running/entity/RunningRecordEntity.java index c5e3d974..0359a470 100644 --- a/src/main/java/com/dnd/runus/infrastructure/persistence/jpa/running/entity/RunningRecordEntity.java +++ b/src/main/java/com/dnd/runus/infrastructure/persistence/jpa/running/entity/RunningRecordEntity.java @@ -39,7 +39,7 @@ public class RunningRecordEntity extends BaseTimeEntity { @NotNull @ManyToOne(fetch = LAZY) - private MemberEntity memberEntity; + private MemberEntity member; @NotNull private Integer distanceMeter; @@ -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()) @@ -100,7 +100,7 @@ public RunningRecord toDomain() { return RunningRecord.builder() .runningId(id) - .member(memberEntity.toDomain()) + .member(member.toDomain()) .distanceMeter(distanceMeter) .durationSeconds(durationSeconds) .calorie(calorie) diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index c3a9c593..5baa7b51 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -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 @@ -15,6 +15,10 @@ spring: username: ${DATABASE_USER} password: ${DATABASE_PASSWORD} + flyway: + enabled: true + baseline-on-migrate: true + app: api: allow-origins: ${ALLOW_ORIGINS} diff --git a/src/test/resources/application.yml b/src/test/resources/application.yml index 582bdcd0..2ec07225 100644 --- a/src/test/resources/application.yml +++ b/src/test/resources/application.yml @@ -1,7 +1,7 @@ spring: jpa: hibernate: - ddl-auto: none + ddl-auto: validate show-sql: true open-in-view: false defer-datasource-initialization: false