Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #22487: Separated schema migration from data migration in test

The data migration failed on Oracle, killing the entire test suite.

Thanks timo for reporting the Oracle breakage,
and andrewgodwin for suggesting the solution.
  • Loading branch information...
commit 64d94cffc73fc4de1389e16d98142d253155b325 1 parent 99f5ea9
@shaib shaib authored
View
11 tests/migration_test_data_persistence/migrations/0001_initial.py
@@ -4,14 +4,6 @@
from django.db import models, migrations
-def add_book(apps, schema_editor):
- apps.get_model("migration_test_data_persistence", "Book").objects.using(
- schema_editor.connection.alias,
- ).create(
- title="I Love Django",
- )
-
-
class Migration(migrations.Migration):
dependencies = [
@@ -28,7 +20,4 @@ class Migration(migrations.Migration):
},
bases=(models.Model,),
),
- migrations.RunPython(
- add_book,
- ),
]
View
23 tests/migration_test_data_persistence/migrations/0002_add_book.py
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations
+
+
+def add_book(apps, schema_editor):
+ apps.get_model("migration_test_data_persistence", "Book").objects.using(
+ schema_editor.connection.alias,
+ ).create(
+ title="I Love Django",
+ )
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [("migration_test_data_persistence", "0001_initial")]
+
+ operations = [
+ migrations.RunPython(
+ add_book,
+ ),
+ ]
Please sign in to comment.
Something went wrong with that request. Please try again.