Introduces discovery for real DB migration validation and operations readiness: - dcy-001_20260430_real-db-migration-validation-and-operations-readiness.md - REQ-001: Local DB validation scenarios (Testing) - REQ-002: Alembic runtime schema ownership (Migration) - REQ-003: Local DB operations runbook and baseline updates (Documentation) Updates discovery and SRS indexes to include new documents.
118 lines
4.9 KiB
Markdown
118 lines
4.9 KiB
Markdown
# req-002: Alembic와 runtime schema ownership 경계 정리
|
|
|
|
- Status: Approved
|
|
- Type: Migration
|
|
- Priority: High
|
|
- Owner: repository-maintainers
|
|
|
|
## Intent
|
|
- 이 요구사항은 Alembic migration 경로와 PostgresPortfolioRepository.ensure_schema() 경로가 같은 schema 객체를 다룰 때 발생할 수 있는 drift와 재실행 실패를 줄이기 위한 경계 규칙을 정의한다.
|
|
- 로컬 docker compose 환경에서 fresh DB와 runtime-precreated schema 상태를 기준으로 허용 순서, 사전 점검, 보정 규칙을 문서화하는 것이 목표다.
|
|
|
|
## Requirement
|
|
- 프로젝트는 로컬 docker compose 기반 DB 환경에서 Alembic migration과 runtime schema bootstrap이 다루는 테이블과 인덱스의 ownership 경계를 식별해야 하며, migrate-db 실행 시 허용되는 순서, 충돌 가능 지점, 사전 점검 규칙, 보정 원칙을 명시해야 한다.
|
|
|
|
## Acceptance Criteria
|
|
1. Given app/repositories/postgres.py와 migrations/versions/ 아래 현재 revision들이 있을 때, When schema ownership 분석을 수행하면, Then Alembic과 runtime ensure_schema()가 다루는 주요 객체와 충돌 가능 지점이 식별되어 있어야 한다.
|
|
2. Given 로컬 docker compose 기반 fresh DB와 app runtime이 일부 schema를 먼저 만든 DB 시나리오가 있을 때, When migrate-db 실행 규칙을 정의하면, Then 허용 순서, 금지 순서, 필요한 사전 점검과 보정 규칙이 문서로 정리되어 있어야 한다.
|
|
3. Given 코드 안에 legacy schema stamp 분기가 남아 있을 때, When migration 경계 문서를 작성하면, Then 이번 REQ와 관련 batch 범위에서 legacy DB 지원이 제외된다는 점이 명시되어 있어야 한다.
|
|
|
|
## Impacted Area
|
|
- Docs: docs/project-structure.md, docs/runtime-flows.md, docs/data-model.md
|
|
- Modules: app/repositories/postgres.py, app/db/migrations.py, migrations/versions/*.py
|
|
- Tests: 로컬 schema ownership 검토 체크리스트 또는 migrate-db 충돌 시나리오 검증 절차
|
|
|
|
## Notes
|
|
- 이 요구사항은 dcy-001의 FR-2, FR-3 일부, S-2, R-1, R-2를 구현 가능한 Migration 단위로 정규화한 것이다.
|
|
- legacy DB support와 legacy stamp 경로 검증은 Discovery 범위에서 이미 제외되었으므로, 이 REQ는 local runtime bootstrap 흔적과 Alembic의 상호작용에 집중한다.
|
|
- 문서화만으로 해결되지 않는 ownership 충돌이 발견되면 후속 batch에서 코드 수정이 필요할 수 있다.
|
|
|
|
## Change Log
|
|
|
|
### CHG-20260430-02
|
|
- Date: 2026-04-30
|
|
- Author: GitHub Copilot
|
|
|
|
#### Change Summary
|
|
- confirm-req 승인 게이트를 통과해 이 REQ를 Approved로 전환했다.
|
|
|
|
#### Intent
|
|
- dcy-001의 delivery input으로 사용할 수 있는 확정 requirement로 승격하기 위해 상태를 변경했다.
|
|
|
|
#### Acceptance Criteria Delta
|
|
- Added:
|
|
- none
|
|
- Updated:
|
|
- none
|
|
- Removed:
|
|
- none
|
|
|
|
#### Impacted Area Delta
|
|
- Docs:
|
|
- docs/srs/index.md
|
|
- Modules:
|
|
- none
|
|
- Tests:
|
|
- none
|
|
|
|
#### Delivery Trace Delta
|
|
- Batches:
|
|
- none
|
|
- Releases:
|
|
- none
|
|
|
|
#### Revalidation Impact
|
|
- Reverification Needed: no
|
|
- Existing Implementation Invalidated: no
|
|
- Status Recommendation: approved
|
|
- Follow-up Action: suggest-batch-reqs 또는 draft-batch 단계에서 REQ-002의 ownership 문서를 delivery scope로 연결한다.
|
|
|
|
#### Validation Plan
|
|
- REQ 본문 필수 섹션, Acceptance Criteria 구체성, docs/srs/index.md 상태 동기화를 확인한다.
|
|
|
|
### CHG-20260430-01
|
|
- Date: 2026-04-30
|
|
- Author: GitHub Copilot
|
|
|
|
#### Change Summary
|
|
- dcy-001에서 Alembic와 runtime schema ownership 경계 요구사항을 신규 Proposed REQ로 생성했다.
|
|
|
|
#### Intent
|
|
- migrate-db와 runtime bootstrap의 경계가 불분명해 생길 수 있는 drift와 재실행 실패를 독립 Migration backlog로 관리하기 위해 생성했다.
|
|
|
|
#### Acceptance Criteria Delta
|
|
- Added:
|
|
- Alembic과 runtime ensure_schema() ownership 분석 기준 정의
|
|
- local runtime-precreated schema 시나리오용 허용 순서와 보정 규칙 정의
|
|
- legacy DB 비지원 범위 명시
|
|
- Updated:
|
|
- none
|
|
- Removed:
|
|
- none
|
|
|
|
#### Impacted Area Delta
|
|
- Docs:
|
|
- docs/project-structure.md
|
|
- docs/runtime-flows.md
|
|
- docs/data-model.md
|
|
- Modules:
|
|
- app/repositories/postgres.py
|
|
- app/db/migrations.py
|
|
- migrations/versions/*.py
|
|
- Tests:
|
|
- migrate-db 충돌 시나리오 검토 체크리스트 또는 동등한 검증 절차
|
|
|
|
#### Delivery Trace Delta
|
|
- Batches:
|
|
- none
|
|
- Releases:
|
|
- none
|
|
|
|
#### Revalidation Impact
|
|
- Reverification Needed: no
|
|
- Existing Implementation Invalidated: no
|
|
- Status Recommendation: keep-current
|
|
- Follow-up Action: confirm-req 단계에서 ownership 경계의 대상 객체와 범위 제외 항목을 검토하고 승인한다.
|
|
|
|
#### Validation Plan
|
|
- confirm-req 전까지 Acceptance Criteria가 dcy-001의 FR-2, FR-3 일부, S-2와 일치하는지 검토하고, 이후 batch 단계에서 실제 객체 목록과 허용 순서 문서를 작성한다. |