feat(S15P11A705-66): core 스키마 마이그레이션과 도메인 엔티티·리포지토리 기반 구축 - #51
Merged
Conversation
place·record·context·collection·collection_record·follow를 부분 유니크 인덱스·CHECK 제약·조회 인덱스와 함께 생성한다. social_account 관련 제약·인덱스는 인증 PR 몫이라 제외했다. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Long FK 컬럼 매핑으로 BD-14(서비스가 memberId 파라미터를 받는 구조)와 정합을 유지한다. place는 BaseEntity를 상속하지 않고 감사 리스너를 직접 붙였고, context는 @PrePersist로 origin_created_at을 첫 생성 시 created_at과 같은 값으로 채우며 교체 생성 시 구 값을 승계한다(BD-25). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
FlywayOutOfOrderTests의 재현 시드가 core.member만 걷어내는 방식이라 V3 테이블(FK로 member를 참조)이 생기자 DROP이 깨졌다. 백엔드 몫을 "core에서 feed_event를 제외한 전부 + 이력 V2~V99"로 일반화해 백엔드 마이그레이션이 늘어도 이 테스트를 따라 고치지 않게 했다. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jira
S15P11A705-66
무엇을
V3__core_domain.sql— core 6개 테이블(place·record·context·collection·collection_record·follow) 생성. 컬럼은 데이터모델 2.3~2.8, 부분 유니크(3.1)·CHECK(3.2)·조회 인덱스(3.3) 포함.social_account관련 제약·인덱스는 인증 PR 몫이라 제외.place는 BaseEntity 미상속 + 감사 리스너 직접 부착,record·collection은@LastModifiedDate직접 선언.context.origin_created_at(BD-25): 첫 생성 시@PrePersist로 자신의created_at과 같은 값, 교체 생성(Context.replacing)은 구 값 승계.FlywayOutOfOrderTests의 BT-02 재현 시드를 "core에서 feed_event 제외 전부 + 이력 V2~V99"로 일반화 — member만 걷어내는 기존 방식이 V3의 FK 때문에 깨졌고, 백엔드 마이그레이션이 늘 때마다 따라 고치지 않게 했다.TDD 증적
FlywayMigrationTests에 6개 테이블·부분 유니크·CHECK·origin_created_at NOT NULL단정 추가 → 5개 실패 확인. 영속성 테스트 5클래스 추가 → 컴파일 실패 확인../gradlew clean check --no-daemon전체 통과 (PostgreSQL Testcontainers).리뷰 포인트
RecordPersistenceTests.softDeletedRecordAllowsNewActiveRecordForSamePlace로 고정했다.@PrePersist에서getCreatedAt()을 읽는 것은 상위 클래스에 선언된AuditingEntityListener가 엔티티 자신의 콜백보다 먼저 실행된다는 JPA 리스너 순서에 기댄다.ContextPersistenceTests.firstContextGetsOriginCreatedAtEqualToItsCreatedAt이 이 전제를 고정한다.🤖 Generated with Claude Code