Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
docs: Document handling noop migrations.
Zixuan James Lica922919f4b0
diff --git a/docs/subsystems/schema-migrations.md b/docs/subsystems/schema-migrations.mdindex e2897773284..3499e3858e5 100644--- a/docs/subsystems/schema-migrations.md+++ b/docs/subsystems/schema-migrations.md@@ -70,6 +70,14 @@ migrations.the entire migration in a transaction. This should make it possibleto use the batch update tools in `zerver/lib/migrate.py` (originallywritten to work with South) for doing larger database migrations.+- **No-op migrations**. Django detects model changes that does not+ necessarily lead to a schema change in the database.+ For example, field validators are a part of the Django ORM, but they+ are not stored in the database. When removing such validators from+ an existing model, nothing gets dropped from the database, but Django+ would still generate a migration for that. We prefer to avoid adding+ this kind of no-op migrations. Instead of generating a new migration,+ you'll want to modify the latest migration affecting the field.- **Accessing code and models in RunPython migrations**. When writinga migration that includes custom python code (aka `RunPython`), you