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:
+5
-2
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user