summaryrefslogtreecommitdiff
path: root/tests/migrations2/test_migrations_2_no_deps/0001_initial.py
diff options
context:
space:
mode:
authorMarkus Holtermann <info@markusholtermann.eu>2015-08-27 09:49:35 +1000
committerMarkus Holtermann <info@markusholtermann.eu>2015-09-19 14:54:53 +1000
commit5aa55038ca9ac44b440b56d1fc4e79c876e51393 (patch)
tree1f6a8fd00c0d796135daee79124fe6e520937332 /tests/migrations2/test_migrations_2_no_deps/0001_initial.py
parent186eb21dc159807dba83148f7c9c50d470745708 (diff)
Fixed #24743, #24745 -- Optimized migration plan handling
The change partly goes back to the old behavior for forwards migrations which should reduce the amount of memory consumption (#24745). However, by the way the current state computation is done (there is no `state_backwards` on a migration class) this change cannot be applied to backwards migrations. Hence rolling back migrations still requires the precomputation and storage of the intermediate migration states. This improvement also implies that Django does not handle mixed migration plans anymore. Mixed plans consist of a list of migrations where some are being applied and others are being unapplied. Thanks Andrew Godwin, Josh Smeaton and Tim Graham for the review as well as everybody involved on the ticket that kept me looking into the issue.
Diffstat (limited to 'tests/migrations2/test_migrations_2_no_deps/0001_initial.py')
-rw-r--r--tests/migrations2/test_migrations_2_no_deps/0001_initial.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/migrations2/test_migrations_2_no_deps/0001_initial.py b/tests/migrations2/test_migrations_2_no_deps/0001_initial.py
new file mode 100644
index 0000000000..2213706594
--- /dev/null
+++ b/tests/migrations2/test_migrations_2_no_deps/0001_initial.py
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = []
+
+ operations = [
+
+ migrations.CreateModel(
+ "OtherAuthor",
+ [
+ ("id", models.AutoField(primary_key=True)),
+ ("name", models.CharField(max_length=255)),
+ ("slug", models.SlugField(null=True)),
+ ("age", models.IntegerField(default=0)),
+ ("silly_field", models.BooleanField(default=False)),
+ ],
+ ),
+
+ ]