Skip to content

post_magazines.status='failed' drift 정합화 #372

@thxforall

Description

@thxforall

배경

2026-04-30 PRD→dev 시드 작업 중 post_magazines.status='failed' check constraint 위반 발생. 진단 결과 SeaORM commit 6351e7c3 (2026-04-22) 에서만 'failed' 가 추가되어 prod 데이터에 흘러들어갔으나, TS 상수 (MAGAZINE_STATUSES) 와 Supabase CLI 마이그레이션은 4-status 그대로. 두 SOT 가 이미 일치하므로 'failed' 폐기 방향 으로 정합화.

위치 'failed' 포함?
packages/web/lib/api/admin/magazines.ts MAGAZINE_STATUSES
supabase/migrations/20260409075040_remote_schema.sql
SeaORM packages/api-server/migration/sql/006_indexes_and_constraints.sql
PRD 실제 데이터 ✅ — 45 row, 모두 2026-03-22 (단일 배치 실패 잔재)

상위 spec: docs/superpowers/specs/2026-04-30-db-operating-model-design.md

산출물

PRD 데이터 + 모든 SOT 가 ('draft','pending','published','rejected') 4-status 로 일관

범위

  1. PRD 데이터 정정: 'failed' 45 row → 'rejected' UPDATE (또는 archive 후 delete — 별도 결정)
  2. SeaORM 측 정정: 006_indexes_and_constraints.sql'failed' 제거 + 새 마이그레이션 (idempotent) 으로 prod check constraint 를 4-status 로 되돌림
  3. dev 로컬 마무리: 임시 alter 된 check constraint 복원, 시드된 'failed' row → 'rejected'
  4. 회귀 방지: 이슈 1 의 "어디 추가하나" 가이드에 본 사례를 inline 인용

Acceptance

  • PRD SELECT DISTINCT status FROM post_magazines 결과가 4 종 이내
  • supabase db reset --no-seed 후 PRD dump 재시드가 constraint alter 없이 통과
  • CI 에서 schema diff 를 돌렸을 때 post_magazines_status_check drift 가 발견되지 않음 (이슈 3 의존)

예상 공수

0.5 일 (의사결정 + 1 마이그레이션 + 데이터 update)

Risk / 선결 조건

  • PRD UPDATE 는 prod write — review + 별도 승인 필요
  • PRD DB 비밀번호 로테이션 선결 (2026-04-30 시드 작업 중 채팅 노출됨)
  • 'failed' 데이터를 archive 형태로 보존할지 의사결정 필요

우선순위

P1

관련: #371

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions