# BAT-006 Index - BAT ID: BAT-006 - Profile: standard - Status: release-candidate - Source Discovery: dcy-004 - Date Created: 2026-05-11 - Folder: docs/batches/bat-006_20260511_portfolio-uuid-migration/ ## Included REQ | REQ | Title | Type | Priority | | --- | --- | --- | --- | | REQ-016 | portfolios 테이블 UUID 전환 및 데이터 마이그레이션 | Migration | High | | REQ-017 | CLI portfolio 명령 — name+user 조합 식별 방식 전환 | Interface | High | | REQ-018 | HTTP API portfolio path parameter UUID 전환 및 v1 asset_id UUID 반환 | Interface | High | | REQ-019 | portfolio UUID 전환 관련 baseline 문서 갱신 | Documentation | Medium | ## Scope Summary - `portfolios.portfolio_id`를 사용자 지정 TEXT에서 서버 생성 UUID(TEXT)로 교체하고, 기존 `portfolio_id` 문자열을 `name` 컬럼으로 이전한다. - `(owner_user_id, name)` 복합 UNIQUE 제약을 DB 레벨에서 도입해 사용자 범위 내 이름 유일성을 보장한다. - 기존 데이터와 FK 참조 테이블(portfolio_ledger, portfolio_comments, portfolio_tags, ledger_trades)을 단일 Alembic revision으로 atomic하게 마이그레이션한다. - CLI portfolio 뮤테이션 명령을 `` + `--user ` 조합 식별 방식으로 전환하고, 내부에서 `(owner_user_id, name)` → UUID 단일 쿼리 조회로 처리한다. - HTTP API path parameter 및 `GET /v1/assets` `asset_id` 반환을 UUID 기반으로 전환하고, dcy-002 A-3 조항을 공식 철회한다. - 위 변경 사항을 baseline 문서(docs/project-structure.md, docs/runtime-flows.md, docs/data-model.md, docs/interface-contract.md)에 반영한다. ## Delivery Documents | Stage | File | Status | | --- | --- | --- | | Index | [index.md](./index.md) | release-candidate | | Planning | [planning.md](./planning.md) | confirmed | | Design | [design.md](./design.md) | confirmed | | Implementation | [implementation.md](./implementation.md) | completed | | Verification | [verification.md](./verification.md) | passed |