diff options
| author | Shai Berger <shai@platonix.com> | 2014-06-11 20:25:02 +0300 |
|---|---|---|
| committer | Shai Berger <shai@platonix.com> | 2014-06-11 20:25:02 +0300 |
| commit | 64d94cffc73fc4de1389e16d98142d253155b325 (patch) | |
| tree | a697cc95064186b7a16a97a701d569a47da4b35a /tests/migration_test_data_persistence/migrations/0002_add_book.py | |
| parent | 99f5ea9cc8f41724e07b88c6142d0092961ce5e0 (diff) | |
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.
Diffstat (limited to 'tests/migration_test_data_persistence/migrations/0002_add_book.py')
| -rw-r--r-- | tests/migration_test_data_persistence/migrations/0002_add_book.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/migration_test_data_persistence/migrations/0002_add_book.py b/tests/migration_test_data_persistence/migrations/0002_add_book.py new file mode 100644 index 0000000000..6ce7fff26b --- /dev/null +++ b/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, + ), + ] |
