From 8317a21ba0f1511aece2d73716e6218bf3e4577c Mon Sep 17 00:00:00 2001 From: seonghyeok Date: Fri, 13 Jun 2025 16:01:11 +0900 Subject: [PATCH 1/7] refactor: InterestedCountryRepository rename --- .../auth/service/EmailSignUpService.java | 6 +++--- .../solidconnection/auth/service/SignUpService.java | 10 +++++----- .../auth/service/oauth/OAuthSignUpService.java | 6 +++--- ...epository.java => InterestedCountryRepository.java} | 2 +- .../service/UniversityRecommendServiceTest.java | 8 ++++---- 5 files changed, 16 insertions(+), 16 deletions(-) rename src/main/java/com/example/solidconnection/location/country/repository/{InterestedCountyRepository.java => InterestedCountryRepository.java} (81%) diff --git a/src/main/java/com/example/solidconnection/auth/service/EmailSignUpService.java b/src/main/java/com/example/solidconnection/auth/service/EmailSignUpService.java index 01e117ea0..4e796b81d 100644 --- a/src/main/java/com/example/solidconnection/auth/service/EmailSignUpService.java +++ b/src/main/java/com/example/solidconnection/auth/service/EmailSignUpService.java @@ -3,7 +3,7 @@ import com.example.solidconnection.auth.dto.SignUpRequest; import com.example.solidconnection.common.exception.CustomException; import com.example.solidconnection.location.country.repository.CountryRepository; -import com.example.solidconnection.location.country.repository.InterestedCountyRepository; +import com.example.solidconnection.location.country.repository.InterestedCountryRepository; import com.example.solidconnection.location.region.repository.InterestedRegionRepository; import com.example.solidconnection.location.region.repository.RegionRepository; import com.example.solidconnection.siteuser.domain.AuthType; @@ -20,9 +20,9 @@ public class EmailSignUpService extends SignUpService { public EmailSignUpService(SignInService signInService, SiteUserRepository siteUserRepository, RegionRepository regionRepository, InterestedRegionRepository interestedRegionRepository, - CountryRepository countryRepository, InterestedCountyRepository interestedCountyRepository, + CountryRepository countryRepository, InterestedCountryRepository interestedCountryRepository, EmailSignUpTokenProvider emailSignUpTokenProvider) { - super(signInService, siteUserRepository, regionRepository, interestedRegionRepository, countryRepository, interestedCountyRepository); + super(signInService, siteUserRepository, regionRepository, interestedRegionRepository, countryRepository, interestedCountryRepository); this.emailSignUpTokenProvider = emailSignUpTokenProvider; } diff --git a/src/main/java/com/example/solidconnection/auth/service/SignUpService.java b/src/main/java/com/example/solidconnection/auth/service/SignUpService.java index 95bd4ecac..8cce448f7 100644 --- a/src/main/java/com/example/solidconnection/auth/service/SignUpService.java +++ b/src/main/java/com/example/solidconnection/auth/service/SignUpService.java @@ -5,7 +5,7 @@ import com.example.solidconnection.common.exception.CustomException; import com.example.solidconnection.location.country.domain.InterestedCountry; import com.example.solidconnection.location.country.repository.CountryRepository; -import com.example.solidconnection.location.country.repository.InterestedCountyRepository; +import com.example.solidconnection.location.country.repository.InterestedCountryRepository; import com.example.solidconnection.location.region.domain.InterestedRegion; import com.example.solidconnection.location.region.repository.InterestedRegionRepository; import com.example.solidconnection.location.region.repository.RegionRepository; @@ -31,17 +31,17 @@ public abstract class SignUpService { protected final RegionRepository regionRepository; protected final InterestedRegionRepository interestedRegionRepository; protected final CountryRepository countryRepository; - protected final InterestedCountyRepository interestedCountyRepository; + protected final InterestedCountryRepository interestedCountryRepository; protected SignUpService(SignInService signInService, SiteUserRepository siteUserRepository, RegionRepository regionRepository, InterestedRegionRepository interestedRegionRepository, - CountryRepository countryRepository, InterestedCountyRepository interestedCountyRepository) { + CountryRepository countryRepository, InterestedCountryRepository interestedCountryRepository) { this.signInService = signInService; this.siteUserRepository = siteUserRepository; this.regionRepository = regionRepository; this.interestedRegionRepository = interestedRegionRepository; this.countryRepository = countryRepository; - this.interestedCountyRepository = interestedCountyRepository; + this.interestedCountryRepository = interestedCountryRepository; } @Transactional @@ -81,7 +81,7 @@ private void saveInterestedCountry(SignUpRequest signUpRequest, SiteUser savedSi List interestedCountries = countryRepository.findByKoreanNames(interestedCountryNames).stream() .map(country -> new InterestedCountry(savedSiteUser, country)) .toList(); - interestedCountyRepository.saveAll(interestedCountries); + interestedCountryRepository.saveAll(interestedCountries); } protected abstract void validateSignUpToken(SignUpRequest signUpRequest); diff --git a/src/main/java/com/example/solidconnection/auth/service/oauth/OAuthSignUpService.java b/src/main/java/com/example/solidconnection/auth/service/oauth/OAuthSignUpService.java index 5676f1c7d..96253f548 100644 --- a/src/main/java/com/example/solidconnection/auth/service/oauth/OAuthSignUpService.java +++ b/src/main/java/com/example/solidconnection/auth/service/oauth/OAuthSignUpService.java @@ -5,7 +5,7 @@ import com.example.solidconnection.auth.service.SignUpService; import com.example.solidconnection.common.exception.CustomException; import com.example.solidconnection.location.country.repository.CountryRepository; -import com.example.solidconnection.location.country.repository.InterestedCountyRepository; +import com.example.solidconnection.location.country.repository.InterestedCountryRepository; import com.example.solidconnection.location.region.repository.InterestedRegionRepository; import com.example.solidconnection.location.region.repository.RegionRepository; import com.example.solidconnection.siteuser.domain.AuthType; @@ -22,9 +22,9 @@ public class OAuthSignUpService extends SignUpService { OAuthSignUpService(SignInService signInService, SiteUserRepository siteUserRepository, RegionRepository regionRepository, InterestedRegionRepository interestedRegionRepository, - CountryRepository countryRepository, InterestedCountyRepository interestedCountyRepository, + CountryRepository countryRepository, InterestedCountryRepository interestedCountryRepository, OAuthSignUpTokenProvider oAuthSignUpTokenProvider) { - super(signInService, siteUserRepository, regionRepository, interestedRegionRepository, countryRepository, interestedCountyRepository); + super(signInService, siteUserRepository, regionRepository, interestedRegionRepository, countryRepository, interestedCountryRepository); this.oAuthSignUpTokenProvider = oAuthSignUpTokenProvider; } diff --git a/src/main/java/com/example/solidconnection/location/country/repository/InterestedCountyRepository.java b/src/main/java/com/example/solidconnection/location/country/repository/InterestedCountryRepository.java similarity index 81% rename from src/main/java/com/example/solidconnection/location/country/repository/InterestedCountyRepository.java rename to src/main/java/com/example/solidconnection/location/country/repository/InterestedCountryRepository.java index 879323e28..2eacc2ca9 100644 --- a/src/main/java/com/example/solidconnection/location/country/repository/InterestedCountyRepository.java +++ b/src/main/java/com/example/solidconnection/location/country/repository/InterestedCountryRepository.java @@ -8,6 +8,6 @@ import java.util.List; @Repository -public interface InterestedCountyRepository extends JpaRepository { +public interface InterestedCountryRepository extends JpaRepository { List findAllBySiteUser(SiteUser siteUser); } diff --git a/src/test/java/com/example/solidconnection/university/service/UniversityRecommendServiceTest.java b/src/test/java/com/example/solidconnection/university/service/UniversityRecommendServiceTest.java index ff274b96a..7169f5021 100644 --- a/src/test/java/com/example/solidconnection/university/service/UniversityRecommendServiceTest.java +++ b/src/test/java/com/example/solidconnection/university/service/UniversityRecommendServiceTest.java @@ -2,7 +2,7 @@ import com.example.solidconnection.location.country.domain.InterestedCountry; import com.example.solidconnection.location.country.fixture.CountryFixture; -import com.example.solidconnection.location.country.repository.InterestedCountyRepository; +import com.example.solidconnection.location.country.repository.InterestedCountryRepository; import com.example.solidconnection.location.region.domain.InterestedRegion; import com.example.solidconnection.location.region.fixture.RegionFixture; import com.example.solidconnection.location.region.repository.InterestedRegionRepository; @@ -34,7 +34,7 @@ class UniversityRecommendServiceTest { private InterestedRegionRepository interestedRegionRepository; @Autowired - private InterestedCountyRepository interestedCountyRepository; + private InterestedCountryRepository interestedCountryRepository; @Autowired private GeneralUniversityRecommendService generalUniversityRecommendService; @@ -97,7 +97,7 @@ void setUp() { @Test void 관심_국가_설정한_사용자의_맞춤_추천_대학을_조회한다() { // given - interestedCountyRepository.save(new InterestedCountry(user, countryFixture.덴마크())); + interestedCountryRepository.save(new InterestedCountry(user, countryFixture.덴마크())); // when UniversityRecommendsResponse response = universityRecommendService.getPersonalRecommends(user); @@ -115,7 +115,7 @@ void setUp() { void 관심_지역과_국가_모두_설정한_사용자의_맞춤_추천_대학을_조회한다() { // given interestedRegionRepository.save(new InterestedRegion(user, regionFixture.영미권())); - interestedCountyRepository.save(new InterestedCountry(user, countryFixture.덴마크())); + interestedCountryRepository.save(new InterestedCountry(user, countryFixture.덴마크())); // when UniversityRecommendsResponse response = universityRecommendService.getPersonalRecommends(user); From cedcb734b3a0032eb48764d4db7bf86055abe10c Mon Sep 17 00:00:00 2001 From: seonghyeok Date: Sat, 14 Jun 2025 00:31:04 +0900 Subject: [PATCH 2/7] =?UTF-8?q?refactor:=20InterestedCountry,=20Interested?= =?UTF-8?q?Region=EC=97=90=20=EB=B3=B5=ED=95=A9=20unique=20=EC=A0=9C?= =?UTF-8?q?=EC=95=BD=20=EC=A1=B0=EA=B1=B4=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 테이블에 제약 조건 설정하는 sql 파일 작성 --- .../location/country/domain/InterestedCountry.java | 8 ++++++++ .../location/region/domain/InterestedRegion.java | 8 ++++++++ .../migration/V15__add_unique_constraint_to_intersted.sql | 7 +++++++ 3 files changed, 23 insertions(+) create mode 100644 src/main/resources/db/migration/V15__add_unique_constraint_to_intersted.sql diff --git a/src/main/java/com/example/solidconnection/location/country/domain/InterestedCountry.java b/src/main/java/com/example/solidconnection/location/country/domain/InterestedCountry.java index 9d75c51ed..b2608487b 100644 --- a/src/main/java/com/example/solidconnection/location/country/domain/InterestedCountry.java +++ b/src/main/java/com/example/solidconnection/location/country/domain/InterestedCountry.java @@ -6,6 +6,8 @@ import jakarta.persistence.GenerationType; import jakarta.persistence.Id; import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; @@ -13,6 +15,12 @@ @Getter @NoArgsConstructor(access = AccessLevel.PROTECTED) @Entity +@Table(uniqueConstraints = { + @UniqueConstraint( + name = "uk_site_user_country", + columnNames = {"site_user_id", "country_code"} + ) +}) public class InterestedCountry { @Id diff --git a/src/main/java/com/example/solidconnection/location/region/domain/InterestedRegion.java b/src/main/java/com/example/solidconnection/location/region/domain/InterestedRegion.java index 457ee4eb6..7489256c5 100644 --- a/src/main/java/com/example/solidconnection/location/region/domain/InterestedRegion.java +++ b/src/main/java/com/example/solidconnection/location/region/domain/InterestedRegion.java @@ -6,6 +6,8 @@ import jakarta.persistence.GenerationType; import jakarta.persistence.Id; import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; @@ -13,6 +15,12 @@ @Getter @NoArgsConstructor(access = AccessLevel.PROTECTED) @Entity +@Table(uniqueConstraints = { + @UniqueConstraint( + name = "uk_site_user_region", + columnNames = {"site_user_id", "region_code"} + ) +}) public class InterestedRegion { @Id diff --git a/src/main/resources/db/migration/V15__add_unique_constraint_to_intersted.sql b/src/main/resources/db/migration/V15__add_unique_constraint_to_intersted.sql new file mode 100644 index 000000000..3aa515166 --- /dev/null +++ b/src/main/resources/db/migration/V15__add_unique_constraint_to_intersted.sql @@ -0,0 +1,7 @@ +ALTER TABLE interested_country +ADD CONSTRAINT uk_site_user_country +UNIQUE (site_user_id, country_code); + +ALTER TABLE interested_region +ADD CONSTRAINT uk_site_user_region +UNIQUE (site_user_id, region_code); \ No newline at end of file From 342216b088c1bf67a34bae0028ce935ad77aeaf7 Mon Sep 17 00:00:00 2001 From: seonghyeok Date: Sat, 14 Jun 2025 10:09:50 +0900 Subject: [PATCH 3/7] =?UTF-8?q?test:=20interested=5Fregion,=20interested?= =?UTF-8?q?=5Fcountry=EC=97=90=20=EB=8C=80=ED=95=9C=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EC=BD=94=EB=93=9C=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repository/CountryRepositoryTest.java | 86 +++++++++++++++++++ .../repository/RegionRepositoryTest.java | 86 +++++++++++++++++++ 2 files changed, 172 insertions(+) create mode 100644 src/test/java/com/example/solidconnection/location/country/repository/CountryRepositoryTest.java create mode 100644 src/test/java/com/example/solidconnection/location/region/repository/RegionRepositoryTest.java diff --git a/src/test/java/com/example/solidconnection/location/country/repository/CountryRepositoryTest.java b/src/test/java/com/example/solidconnection/location/country/repository/CountryRepositoryTest.java new file mode 100644 index 000000000..d377cb5ee --- /dev/null +++ b/src/test/java/com/example/solidconnection/location/country/repository/CountryRepositoryTest.java @@ -0,0 +1,86 @@ +package com.example.solidconnection.location.country.repository; + +import com.example.solidconnection.location.country.domain.Country; +import com.example.solidconnection.location.country.domain.InterestedCountry; +import com.example.solidconnection.location.country.fixture.CountryFixture; +import com.example.solidconnection.siteuser.domain.SiteUser; +import com.example.solidconnection.siteuser.fixture.SiteUserFixture; +import com.example.solidconnection.support.TestContainerSpringBootTest; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.dao.DataIntegrityViolationException; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatCode; + +@TestContainerSpringBootTest +public class CountryRepositoryTest { + + @Autowired + private InterestedCountryRepository interestedCountryRepository; + + @Autowired + private SiteUserFixture siteUserFixture; + + @Autowired + private CountryFixture countryFixture; + + @Nested + class 사용자와_나라는_복합_유니크_제약_조건을_가진다 { + + @Test + void 같은_사용자가_같은_나라에_관심_표시를_하면_예외_응답을_반환한다() { + // given + SiteUser user = siteUserFixture.사용자(); + Country country = countryFixture.미국(); + + InterestedCountry firstInterest = new InterestedCountry(user, country); + interestedCountryRepository.save(firstInterest); + + InterestedCountry secondInterest = new InterestedCountry(user, country); + + // when & then + assertThatCode(() -> interestedCountryRepository.save(secondInterest)) + .isInstanceOf(DataIntegrityViolationException.class); + } + + @Test + void 다른_사용자가_같은_나라에_관심_표시를_하면_정상_저장된다() { + // given + SiteUser user1 = siteUserFixture.사용자(1, "user1"); + SiteUser user2 = siteUserFixture.사용자(2, "user2"); + Country country = countryFixture.미국(); + + InterestedCountry firstInterest = new InterestedCountry(user1, country); + interestedCountryRepository.save(firstInterest); + + InterestedCountry secondInterest = new InterestedCountry(user2, country); + + // when & then + assertThatCode(() -> { + InterestedCountry saved = interestedCountryRepository.save(secondInterest); + assertThat(saved.getId()).isNotNull(); + }).doesNotThrowAnyException(); + } + + @Test + void 같은_사용자가_다른_나라에_관심_표시를_하면_정상_저장된다() { + // given + SiteUser user = siteUserFixture.사용자(); + Country country1 = countryFixture.미국(); + Country country2 = countryFixture.일본(); + + InterestedCountry firstInterest = new InterestedCountry(user, country1); + interestedCountryRepository.save(firstInterest); + + InterestedCountry secondInterest = new InterestedCountry(user, country2); + + // when & then + assertThatCode(() -> { + InterestedCountry saved = interestedCountryRepository.save(secondInterest); + assertThat(saved.getId()).isNotNull(); + }).doesNotThrowAnyException(); + } + } +} diff --git a/src/test/java/com/example/solidconnection/location/region/repository/RegionRepositoryTest.java b/src/test/java/com/example/solidconnection/location/region/repository/RegionRepositoryTest.java new file mode 100644 index 000000000..9a7a112df --- /dev/null +++ b/src/test/java/com/example/solidconnection/location/region/repository/RegionRepositoryTest.java @@ -0,0 +1,86 @@ +package com.example.solidconnection.location.region.repository; + +import com.example.solidconnection.location.region.domain.InterestedRegion; +import com.example.solidconnection.location.region.domain.Region; +import com.example.solidconnection.location.region.fixture.RegionFixture; +import com.example.solidconnection.siteuser.domain.SiteUser; +import com.example.solidconnection.siteuser.fixture.SiteUserFixture; +import com.example.solidconnection.support.TestContainerSpringBootTest; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.dao.DataIntegrityViolationException; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatCode; + +@TestContainerSpringBootTest +public class RegionRepositoryTest { + + @Autowired + private InterestedRegionRepository interestedRegionRepository; + + @Autowired + private SiteUserFixture siteUserFixture; + + @Autowired + private RegionFixture regionFixture; + + @Nested + class 사용자와_지역은_복합_유니크_제약_조건을_가진다 { + + @Test + void 같은_사용자가_같은_지역에_관심_표시를_하면_예외_응답을_반환한다() { + // given + SiteUser user = siteUserFixture.사용자(); + Region region = regionFixture.영미권(); + + InterestedRegion firstInterest = new InterestedRegion(user, region); + interestedRegionRepository.save(firstInterest); + + InterestedRegion secondInterest = new InterestedRegion(user, region); + + // when & then + assertThatCode(() -> interestedRegionRepository.save(secondInterest)) + .isInstanceOf(DataIntegrityViolationException.class); + } + + @Test + void 다른_사용자가_같은_지역에_관심_표시를_하면_정상_저장된다() { + // given + SiteUser user1 = siteUserFixture.사용자(1, "user1"); + SiteUser user2 = siteUserFixture.사용자(2, "user2"); + Region region = regionFixture.영미권(); + + InterestedRegion firstInterest = new InterestedRegion(user1, region); + interestedRegionRepository.save(firstInterest); + + InterestedRegion secondInterest = new InterestedRegion(user2, region); + + // when & then + assertThatCode(() -> { + InterestedRegion saved = interestedRegionRepository.save(secondInterest); + assertThat(saved.getId()).isNotNull(); + }).doesNotThrowAnyException(); + } + + @Test + void 같은_사용자가_다른_지역에_관심_표시를_하면_정상_저장된다() { + // given + SiteUser user = siteUserFixture.사용자(); + Region region1 = regionFixture.영미권(); + Region region2 = regionFixture.유럽(); + + InterestedRegion firstInterest = new InterestedRegion(user, region1); + interestedRegionRepository.save(firstInterest); + + InterestedRegion secondInterest = new InterestedRegion(user, region2); + + // when & then + assertThatCode(() -> { + InterestedRegion saved = interestedRegionRepository.save(secondInterest); + assertThat(saved.getId()).isNotNull(); + }).doesNotThrowAnyException(); + } + } +} From 4060e5421f905a9f9e8952a8c1a01c47c1d78c65 Mon Sep 17 00:00:00 2001 From: seonghyeok Date: Thu, 19 Jun 2025 10:16:57 +0900 Subject: [PATCH 4/7] =?UTF-8?q?chore:=20CountryRepositoryTest,=20RegionRep?= =?UTF-8?q?ositoryTest=20=ED=8C=8C=EC=9D=BC=EB=AA=85=20=EC=95=9E=EC=97=90?= =?UTF-8?q?=20Interested=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...RepositoryTest.java => InterestedCountryRepositoryTest.java} | 2 +- ...nRepositoryTest.java => InterestedRegionRepositoryTest.java} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename src/test/java/com/example/solidconnection/location/country/repository/{CountryRepositoryTest.java => InterestedCountryRepositoryTest.java} (98%) rename src/test/java/com/example/solidconnection/location/region/repository/{RegionRepositoryTest.java => InterestedRegionRepositoryTest.java} (98%) diff --git a/src/test/java/com/example/solidconnection/location/country/repository/CountryRepositoryTest.java b/src/test/java/com/example/solidconnection/location/country/repository/InterestedCountryRepositoryTest.java similarity index 98% rename from src/test/java/com/example/solidconnection/location/country/repository/CountryRepositoryTest.java rename to src/test/java/com/example/solidconnection/location/country/repository/InterestedCountryRepositoryTest.java index d377cb5ee..4daeb55e1 100644 --- a/src/test/java/com/example/solidconnection/location/country/repository/CountryRepositoryTest.java +++ b/src/test/java/com/example/solidconnection/location/country/repository/InterestedCountryRepositoryTest.java @@ -15,7 +15,7 @@ import static org.assertj.core.api.Assertions.assertThatCode; @TestContainerSpringBootTest -public class CountryRepositoryTest { +public class InterestedCountryRepositoryTest { @Autowired private InterestedCountryRepository interestedCountryRepository; diff --git a/src/test/java/com/example/solidconnection/location/region/repository/RegionRepositoryTest.java b/src/test/java/com/example/solidconnection/location/region/repository/InterestedRegionRepositoryTest.java similarity index 98% rename from src/test/java/com/example/solidconnection/location/region/repository/RegionRepositoryTest.java rename to src/test/java/com/example/solidconnection/location/region/repository/InterestedRegionRepositoryTest.java index 9a7a112df..a9594e0f8 100644 --- a/src/test/java/com/example/solidconnection/location/region/repository/RegionRepositoryTest.java +++ b/src/test/java/com/example/solidconnection/location/region/repository/InterestedRegionRepositoryTest.java @@ -15,7 +15,7 @@ import static org.assertj.core.api.Assertions.assertThatCode; @TestContainerSpringBootTest -public class RegionRepositoryTest { +public class InterestedRegionRepositoryTest { @Autowired private InterestedRegionRepository interestedRegionRepository; From ad9722e61cc1efd603d64992afa054b95e645bd3 Mon Sep 17 00:00:00 2001 From: seonghyeok Date: Thu, 19 Jun 2025 10:18:07 +0900 Subject: [PATCH 5/7] =?UTF-8?q?chore:=20=ED=8C=8C=EC=9D=BC=20=EB=81=9D=20?= =?UTF-8?q?=EA=B0=9C=ED=96=89=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V15__add_unique_constraint_to_intersted.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/db/migration/V15__add_unique_constraint_to_intersted.sql b/src/main/resources/db/migration/V15__add_unique_constraint_to_intersted.sql index 3aa515166..b35b1e635 100644 --- a/src/main/resources/db/migration/V15__add_unique_constraint_to_intersted.sql +++ b/src/main/resources/db/migration/V15__add_unique_constraint_to_intersted.sql @@ -4,4 +4,4 @@ UNIQUE (site_user_id, country_code); ALTER TABLE interested_region ADD CONSTRAINT uk_site_user_region -UNIQUE (site_user_id, region_code); \ No newline at end of file +UNIQUE (site_user_id, region_code); From 0212b4524bdd20178a8c166776c799ed2977db2c Mon Sep 17 00:00:00 2001 From: seonghyeok Date: Thu, 19 Jun 2025 10:25:40 +0900 Subject: [PATCH 6/7] =?UTF-8?q?chore:=20UK=20=EC=A0=9C=EC=95=BD=EC=A1=B0?= =?UTF-8?q?=EA=B1=B4=20=EC=9D=B4=EB=A6=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../location/country/domain/InterestedCountry.java | 2 +- .../location/region/domain/InterestedRegion.java | 2 +- .../db/migration/V15__add_unique_constraint_to_intersted.sql | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/example/solidconnection/location/country/domain/InterestedCountry.java b/src/main/java/com/example/solidconnection/location/country/domain/InterestedCountry.java index b2608487b..edc68ba79 100644 --- a/src/main/java/com/example/solidconnection/location/country/domain/InterestedCountry.java +++ b/src/main/java/com/example/solidconnection/location/country/domain/InterestedCountry.java @@ -17,7 +17,7 @@ @Entity @Table(uniqueConstraints = { @UniqueConstraint( - name = "uk_site_user_country", + name = "uk_interested_country_site_user_id_country_code", columnNames = {"site_user_id", "country_code"} ) }) diff --git a/src/main/java/com/example/solidconnection/location/region/domain/InterestedRegion.java b/src/main/java/com/example/solidconnection/location/region/domain/InterestedRegion.java index 7489256c5..35214a95c 100644 --- a/src/main/java/com/example/solidconnection/location/region/domain/InterestedRegion.java +++ b/src/main/java/com/example/solidconnection/location/region/domain/InterestedRegion.java @@ -17,7 +17,7 @@ @Entity @Table(uniqueConstraints = { @UniqueConstraint( - name = "uk_site_user_region", + name = "uk_interested_region_site_user_id_region_code", columnNames = {"site_user_id", "region_code"} ) }) diff --git a/src/main/resources/db/migration/V15__add_unique_constraint_to_intersted.sql b/src/main/resources/db/migration/V15__add_unique_constraint_to_intersted.sql index b35b1e635..2f7a8524c 100644 --- a/src/main/resources/db/migration/V15__add_unique_constraint_to_intersted.sql +++ b/src/main/resources/db/migration/V15__add_unique_constraint_to_intersted.sql @@ -1,7 +1,7 @@ ALTER TABLE interested_country -ADD CONSTRAINT uk_site_user_country +ADD CONSTRAINT uk_interested_country_site_user_id_country_code UNIQUE (site_user_id, country_code); ALTER TABLE interested_region -ADD CONSTRAINT uk_site_user_region +ADD CONSTRAINT uk_interested_region_site_user_id_region_code UNIQUE (site_user_id, region_code); From 8f534a7ddebed6c1f27d090748baf96dd76ecc78 Mon Sep 17 00:00:00 2001 From: seonghyeok Date: Wed, 25 Jun 2025 01:16:06 +0900 Subject: [PATCH 7/7] =?UTF-8?q?chore:=20=EB=A7=88=EC=9D=B4=EA=B7=B8?= =?UTF-8?q?=EB=A0=88=EC=9D=B4=EC=85=98=20=ED=8C=8C=EC=9D=BC=20=EB=B2=84?= =?UTF-8?q?=EC=A0=84=20=EC=88=98=EC=A0=95=20V15=20->=20V16?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ..._intersted.sql => V16__add_unique_constraint_to_intersted.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/main/resources/db/migration/{V15__add_unique_constraint_to_intersted.sql => V16__add_unique_constraint_to_intersted.sql} (100%) diff --git a/src/main/resources/db/migration/V15__add_unique_constraint_to_intersted.sql b/src/main/resources/db/migration/V16__add_unique_constraint_to_intersted.sql similarity index 100% rename from src/main/resources/db/migration/V15__add_unique_constraint_to_intersted.sql rename to src/main/resources/db/migration/V16__add_unique_constraint_to_intersted.sql