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