From 79b6345cb95bf12df961170493ae946ed05974b8 Mon Sep 17 00:00:00 2001 From: Konrad du Plessis Date: Tue, 24 Mar 2026 21:22:42 +0200 Subject: [PATCH] Document /run-migrate/ endpoint and unreliable auto-migrations Flatlogic doesn't always run migrations on Pull Latest. Added note about using /run-migrate/ to fix "Unknown column" errors after deploy. Co-Authored-By: Claude Opus 4.6 --- CLAUDE.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index 61c90c5..7d3afd4 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -126,6 +126,7 @@ python manage.py check # System check | `/payroll/payslip//` | `payslip_detail` | Admin: view completed payslip | | `/receipts/create/` | `create_receipt` | Staff: expense receipt with line items | | `/import-data/` | `import_data` | Setup: run import command from browser | +| `/run-migrate/` | `run_migrate` | Setup: run pending DB migrations from browser | ## Frontend Design Conventions - **CSS variables** in `static/css/custom.css` `:root` — always use `var(--name)`: @@ -164,7 +165,7 @@ PROJECT_DESCRIPTION, PROJECT_IMAGE_URL # Flatlogic branding - **Branches**: `ai-dev` = development (Flatlogic AI + Claude Code). `master` = deploy target. - **Workflow**: Push to `ai-dev` → Flatlogic auto-detects → "Pull Latest" → app rebuilds (~5 min) - **Deploy from Git** (Settings): Full rebuild from `master` — use for production -- **Migrations**: Run automatically during Flatlogic rebuild +- **Migrations**: Sometimes run automatically during rebuild, but NOT always reliable. If you get "Unknown column" errors after pulling latest, visit `/run-migrate/` in the browser to apply pending migrations manually. This endpoint runs `python manage.py migrate` on the production MySQL database. - **Never edit `ai-dev` directly on GitHub** — Flatlogic pushes overwrite it - **Gemini gotcha**: Flatlogic's Gemini AI reads `__pycache__/*.pyc` and gets confused. Tell it: "Do NOT read .pyc files. Only work with .py source files." - **Sequential workflow**: Don't edit in Flatlogic and Claude Code at the same time