db-foundation
main
ステップ2: DB の土台を追加する。あわせて yt-dlp の進捗読み取りの実機調査(ステップ2a)の結果を PROJECT.md に記録する。
internal/store/migrations/001_initial.sql
download_jobs
episode_id
subscriptions
internal/store/migrate.go
schema_migrations
pg_advisory_lock
internal/store/store.go
FOR UPDATE SKIP LOCKED
Dockerfile
go.sum
PROJECT.md
web・worker への組み込みと画面は範囲外(ステップ3以降)。
go test -count=1 ./...
go vet ./...
docker build
/healthz
🤖 Generated with Claude Code
https://claude.ai/code/session_01BcuBr9DyfcqZY8xFQsY5Di
No dependencies set.
The note is not visible to the blocked user.
概要
ステップ2: DB の土台を追加する。あわせて yt-dlp の進捗読み取りの実機調査(ステップ2a)の結果を PROJECT.md に記録する。
internal/store/migrations/001_initial.sql:download_jobs(episode_id一意、状態・段階別進捗・失敗分類・保存先、CHECK 制約、索引)とsubscriptionsinternal/store/migrate.go: 埋め込み SQL をschema_migrationsで管理し、pg_advisory_lockで同時適用を直列化internal/store/store.go: Enqueue / Retry / ClaimNext(FOR UPDATE SKIP LOCKED)/ UpdateProgress / Complete / Fail / Cancel / RequeueStale、一覧・状態一括取得、番組登録の操作Dockerfile:go.sumの COPY とモジュール取得の層PROJECT.md: DB 方式(NAS 上の tver 専用 Postgres 17)、テスト方式、yt-dlp 調査結果(pycryptodomex 必須、段階別進捗、after_move、ffprobe、中断再開、失敗文言)、worker の方針、確かめ方web・worker への組み込みと画面は範囲外(ステップ3以降)。
確認
go test -count=1 ./...→ 53件成功・0失敗(QA が索引の実在、SKIP LOCKED、一覧・状態遷移・RequeueStale 境界などを追加)go vet ./...→ 指摘0件docker buildと/healthz200 を確認(検証用リソースは削除済み)🤖 Generated with Claude Code
https://claude.ai/code/session_01BcuBr9DyfcqZY8xFQsY5Di