From 4e2b5bf200d0d989721f90aa6dc3a5166f54d263 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Mon, 10 Jul 2017 16:02:19 -0700 Subject: [PATCH] docs: Document naming for schema migrations. --- docs/schema-migrations.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/schema-migrations.md b/docs/schema-migrations.md index a15a97b52e..7b2bd2e556 100644 --- a/docs/schema-migrations.md +++ b/docs/schema-migrations.md @@ -8,6 +8,15 @@ tutorial](new-feature-tutorial.html). This page documents some important issues related to writing schema migrations. +* **Naming**: Please provide clear names for new database migrations + (e.g. `0072_realmauditlog_add_index_event_time.py`). Since in the + Django migrations system, the filename is the name for the + migration, this just means moving the migration file to have a + reasonable name. Note that `tools/test-migrations` will fail in + Travis CI if a migration has bad name of the form + `0089_auto_20170710_1353.py`, which are what Django generates + automatically for nontrivial database schema changes. + * **Large tables**: For large tables like Message and UserMessage, you want to take precautions when adding columns to the table, performing data backfills, or building indexes. We have a