Local dev and the test suite previously defaulted to the live production Neon database, and running the tests mutated prod data. Add guardrails plus a proper local Postgres + migrations workflow so production can't be hit by mistake: - docker-compose: local Postgres 17 (matches prod) + auto-created teqo_test - dev guard refuses a non-local DATABASE_URL; tests refuse non-_test databases - .env.test isolates the suite; vitest/playwright load it and fail closed - Payload migrations set up (push disabled); build runs `payload migrate`, so deploys apply pending migrations to prod automatically - baseline `initial` migration + idempotent consent.text varchar->jsonb fix - `pnpm db:pull` copies prod content locally, excluding supporter PII - docs (README, AGENTS.md) + agent skills for the local-db/migration workflow
14 lines
699 B
Text
14 lines
699 B
Text
# Copy this file to `.env.local` for local development.
|
|
#
|
|
# For LOCAL DEVELOPMENT, DATABASE_URL must point at the local Postgres started by
|
|
# docker-compose (`pnpm db:start`). `pnpm dev` will REFUSE to start against a
|
|
# non-local host (e.g. the production Neon database) unless you explicitly set
|
|
# ALLOW_REMOTE_DB=true — this is intentional, to protect production data.
|
|
DATABASE_URL=postgresql://teqo:teqo@localhost:5432/teqo
|
|
|
|
PAYLOAD_SECRET=YOUR_SECRET_HERE
|
|
BLOB_READ_WRITE_TOKEN=YOUR_BLOB_TOKEN_HERE
|
|
NEXT_PUBLIC_SITE_URL=http://localhost:3000
|
|
|
|
# Note: the automated test suite ignores this file and reads .env.test instead,
|
|
# and only ever runs against a database whose name ends with "_test".
|