Files
GearBox/.planning/phases/33-currency-system/33-02-PLAN.md
Jean-Luc Makiola 7a696f39a5 docs(33): create phase plans for currency system
6 plans across 3 waves covering market-aware pricing, exchange rates,
community price data, and currency-normalized display.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 17:58:37 +02:00

3.9 KiB

phase, plan, type, wave, depends_on, files_modified, autonomous, requirements, must_haves
phase plan type wave depends_on files_modified autonomous requirements must_haves
33-currency-system 02 execute 1
01
drizzle-pg/meta/_journal.json
true
D-01
D-02
D-03
D-06
D-07
truths artifacts key_links
Database schema matches Drizzle schema definitions
market_prices table exists in the database
community_prices table exists in the database
items table has price_currency column
thread_candidates table has found_price_cents, found_price_currency, found_price_date columns
path provides
drizzle-pg/ Migration SQL file for new tables and columns
from to via pattern
src/db/schema.ts drizzle-pg/ bun run db:generate market_prices|community_prices
Generate and apply database migration for the new market pricing tables and columns.

Purpose: [BLOCKING] Schema push — database must match code before any API work can proceed. Without this, TypeScript types pass (from config) but runtime queries fail. Output: Migration SQL applied to database.

<execution_context> @$HOME/.claude/get-shit-done/workflows/execute-plan.md @$HOME/.claude/get-shit-done/templates/summary.md </execution_context>

@.planning/PROJECT.md @.planning/STATE.md @.planning/phases/33-currency-system/33-01-SUMMARY.md Task 1: [BLOCKING] Generate and push database migration drizzle-pg/ src/db/schema.ts, drizzle.config.ts Run Drizzle migration generation and push:
  1. Generate migration: bun run db:generate

    • This reads src/db/schema.ts and produces a SQL migration file in drizzle-pg/
    • Expected: creates new migration for market_prices table, community_prices table, and new columns on items/thread_candidates
  2. Apply migration: bun run db:push

    • Applies the generated migration to the PostgreSQL database
    • Verify by checking that the migration was applied without errors
  3. Verify tables exist by running a quick query or checking the migration output

Note: Drizzle ORM detected, push command is bun run db:push (per project CLAUDE.md). Non-TTY compatible — no interactive prompts expected. <acceptance_criteria> - A new migration SQL file exists in drizzle-pg/ containing CREATE TABLE market_prices - A new migration SQL file exists in drizzle-pg/ containing CREATE TABLE community_prices - Migration SQL contains ALTER TABLE items ADD COLUMN price_currency - Migration SQL contains ALTER TABLE thread_candidates ADD COLUMN found_price_cents - bun run db:push exits with code 0 </acceptance_criteria> cd /home/jlmak/Projects/jlmak/GearBox && ls drizzle-pg/*.sql | tail -1 | xargs grep -c "market_prices|community_prices" Database schema matches Drizzle definitions — all new tables and columns exist in the live database

<threat_model>

Trust Boundaries

Boundary Description
None Schema migration is an internal operation with no external trust boundaries

STRIDE Threat Register

Threat ID Category Component Disposition Mitigation Plan
T-33-05 Tampering migration SQL accept Migrations are generated from code and applied by the developer — no external input
</threat_model>
- Migration file exists in drizzle-pg/ with correct DDL - `bun run db:push` completes successfully - No runtime errors when querying new tables

<success_criteria>

  • Database has market_prices and community_prices tables
  • items table has price_currency column
  • thread_candidates table has found_price_cents, found_price_currency, found_price_date columns </success_criteria>
After completion, create `.planning/phases/33-currency-system/33-02-SUMMARY.md`