fix(seed): never run the demo seed as part of a deploy
CI / build (push) Has been cancelled

The migrate task chained db:seed, so every production deploy inserted demo
users, duplicate Sunday templates and 45 fake assignments, and its unconditional
assignment delete wiped real schedule data. Migrations now run alone, and the
seed aborts when the database already holds non-seed users unless SEED_FORCE=1
is set for a throwaway database.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
2026-11-22 21:34:02 +00:00
parent ade21425d4
commit f71952f838
3 changed files with 35 additions and 7 deletions
+5 -2
View File
@@ -159,14 +159,17 @@ services:
retries: 10
restart: unless-stopped
# One-shot migrations + seed. Run on demand:
# One-shot migrations. Run on demand:
# docker compose --profile tools run --rm migrate
# Seed is intentionally separate: it inserts demo users/services and rewrites
# assignments, so it must never run as part of a production deploy. On a
# fresh install run: docker compose --profile tools run --rm migrate pnpm db:seed
migrate:
build:
context: .
dockerfile: Dockerfile
target: tools
command: ["sh", "-c", "pnpm db:migrate && pnpm db:seed"]
command: ["pnpm", "db:migrate"]
environment:
DATABASE_URL: postgres://${POSTGRES_USER:-media}:${POSTGRES_PASSWORD:-media}@db:5432/${POSTGRES_DB:-media}
depends_on: