Memex Admin

Backend: Model Changes Require Migrations

Repository: mem-labs/mem

activeUpdated Feb 18, 2026, 8:56 PM

Policy ID js7d6sah88jhfrtr448fvz4gjx81dqas

Backend model migration sync rule.

Scope:
- Applies only when runtime model files change under `domains/python/backend/app/src/models/**`.
- Ignore test-only, docs-only, comment-only, and `__init__.py`-only changes.

Trigger:
- At least one changed model file adds/removes schema declarations, including:
  - `models.<FieldType>(...)` field assignments,
  - relationship fields (`ForeignKey`, `ManyToManyField`, `OneToOneField`),
  - model `Meta` schema attributes (`indexes`, `constraints`, `unique_together`, `index_together`, `db_table`).

Hard requirements:
1) At least one migration file must be added or changed under `domains/python/backend/app/src/migrations/**`.

Decision:
- Return NOT APPROVED when the trigger is met and no migration file change is present.
- Otherwise APPROVED for this policy.