--- id: 4f3d2923-25af-4548-85ae-df7285fa129d type: solution title: "PostgreSQL migration workflow for Major Domo" tags: [major-domo, postgresql, migrations, docker, workflow] importance: 0.7 confidence: 0.8 created: "2025-12-09T22:44:52.229579+00:00" updated: "2025-12-09T22:44:52.229579+00:00" --- Manual migration workflow for Major Domo database: 1. Create SQL file in migrations/ with timestamp: YYYY-MM-DD_description.sql 2. Update Peewee model in app/db_engine.py to match 3. Apply via SSH to dev server (10.10.0.42): ssh 10.10.0.42 "docker exec -i sba_postgres psql -U sba_admin -d sba_master -c 'SQL HERE'" 4. Production is on Akamai Linode (ssh akamai, cd container-data/sba-database) Key gotchas: - Table names are SINGULAR (team, player, etc.) not plural - Container name is sba_postgres (underscore, not hyphen) - No psql on local machine - must SSH and use docker exec - Use IF NOT EXISTS for idempotent migrations - Peewee FloatField maps to PostgreSQL REAL type