Remove seed step: migrate all content to Postgres-only backend #13

Merged
LordSchmackes merged 1 commits from dev into main 2026-06-22 08:38:40 +00:00
LordSchmackes commented 2026-06-18 08:02:53 +00:00 (Migrated from github.com)

Summary

  • Removes the seed step entirely — fresh deploys no longer need RUN_DB_SEED=true or any CLI command
  • Deletes static JSON files (data/recipes.json, data/site.json) — Postgres is now the single source of truth for all content
  • load_site_settings() no longer throws when site_settings table is empty; returns default_site_settings() placeholders instead of a 503
  • Removes legacy JSONB migration path from helpers.php
  • Drops RUN_DB_SEED env var from docker-compose.yml and the seed block from docker/entrypoint.sh
  • Updates docs/COOLIFY.md to reflect the new seedless deployment workflow
  • Adds .claude/launch.json with dev server launch configurations

New deployment flow

  1. Deploy with DATABASE_URL + FLIXCOOKS_ADMIN_KEY
  2. Container starts → schema auto-applied → site runs immediately
  3. Admin fills in recipes + legal settings via /admin.php — no CLI step needed

Behaviour with empty DB (tested locally)

Before After
HTTP 503 „Datenbank nicht verfügbar" Site renders normally — 0 recipes, placeholder imprint/privacy

Test plan

  • Verified 4 recipes + 40 site_settings rows in local DB before removing seed files
  • Truncated local DB → confirmed site loads without 503
  • Re-seeded via docker exec to restore dev state
  • docker compose up --build starts cleanly without RUN_DB_SEED

Prod migration note

Before merging, export local DB content and restore to prod:

docker exec flixcooks-website-postgres-1 pg_dump \
  -U flixcooks -d flixcooks --data-only --disable-triggers \
  -t recipes -t recipe_translations -t recipe_tags \
  -t recipe_ingredients -t recipe_utensils -t recipe_steps \
  -t site_settings > prod-seed.sql
# then: psql <PROD_DATABASE_URL> < prod-seed.sql

🤖 Generated with Claude Code

## Summary - **Removes the seed step entirely** — fresh deploys no longer need `RUN_DB_SEED=true` or any CLI command - **Deletes static JSON files** (`data/recipes.json`, `data/site.json`) — Postgres is now the single source of truth for all content - **`load_site_settings()` no longer throws** when `site_settings` table is empty; returns `default_site_settings()` placeholders instead of a 503 - Removes legacy JSONB migration path from `helpers.php` - Drops `RUN_DB_SEED` env var from `docker-compose.yml` and the seed block from `docker/entrypoint.sh` - Updates `docs/COOLIFY.md` to reflect the new seedless deployment workflow - Adds `.claude/launch.json` with dev server launch configurations ## New deployment flow 1. Deploy with `DATABASE_URL` + `FLIXCOOKS_ADMIN_KEY` 2. Container starts → schema auto-applied → site runs immediately 3. Admin fills in recipes + legal settings via `/admin.php` — no CLI step needed ## Behaviour with empty DB (tested locally) | Before | After | |--------|-------| | HTTP 503 „Datenbank nicht verfügbar" | Site renders normally — 0 recipes, placeholder imprint/privacy | ## Test plan - [x] Verified 4 recipes + 40 site_settings rows in local DB before removing seed files - [x] Truncated local DB → confirmed site loads without 503 - [x] Re-seeded via `docker exec` to restore dev state - [x] `docker compose up --build` starts cleanly without `RUN_DB_SEED` ## Prod migration note Before merging, export local DB content and restore to prod: ```bash docker exec flixcooks-website-postgres-1 pg_dump \ -U flixcooks -d flixcooks --data-only --disable-triggers \ -t recipes -t recipe_translations -t recipe_tags \ -t recipe_ingredients -t recipe_utensils -t recipe_steps \ -t site_settings > prod-seed.sql # then: psql <PROD_DATABASE_URL> < prod-seed.sql ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.