SoConnective

Architecture

ADR 0007 — Backend schema via migrations (not push)

  • Status: Accepted
  • Date: 2026-06-12

Context

The Payload backend (apps/cms) runs on Postgres with push: true. push (drizzle dev-sync) only runs in development; in production (NODE_ENV=production) Payload does not push — the schema is governed by migrations (src/migrations/ + the payload_migrations table). This surfaced when a new tasks collection deployed (route registered, 403) but its table was never created.

Decision

Production schema changes go through committed Payload migrations: pnpm payload migrate:create <name> → review → pnpm payload migrate, with the generated .ts + .json committed. push stays for local dev only. The deploy pipeline runs migrate.

Consequences

  • Reproducible, reviewable schema history; no silent/destructive auto-sync in prod.
  • Binding rule G-24 added; the "push in prod" risk in the roadmap is resolved.
Previous
ADR 0006 — Native automation & conversations (no n8n, no Chatwoot)