From 99ceeff5b8796d9723b1ffc3ba6221b2b337da30 Mon Sep 17 00:00:00 2001 From: Yisroel Baum Date: Fri, 31 Jul 2026 10:55:26 +0300 Subject: [PATCH] document production migrations --- ai/backend-context.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ai/backend-context.md b/ai/backend-context.md index 34729b2..3395a52 100644 --- a/ai/backend-context.md +++ b/ai/backend-context.md @@ -40,11 +40,14 @@ intentionally omitted here - update this section as entities land. ## Migrations -- This project is not in production. By default, schema changes should update - the relevant create-table migration so migrations describe the current desired - schema from scratch. -- Do not add alter-table or data-backfill migrations unless the user explicitly - asks for production-style migration safety. +- This project is in production. Never edit, delete, rename, or reorder an + existing migration file. Every schema change must use a new forward + migration. +- Production migrations must preserve existing data, include any required + backfill, and define a safe rollback. +- Plan schema changes for the deployment order and for compatibility between + the old and new application versions. Use expand/backfill/contract sequencing + when a single compatible migration is not safe. - Put seed data in seeders, not migrations. ## PHP rules