Add schema evolution compatibility for Django 1.7, 1.8, and 1.9.
Review Request #8109 — Created April 8, 2016 and submitted
This updates the compatibility modules in Django Evolution to support Django 1.7 through 1.9. These make use of the new Schema Editor functionality introduced with Django 1.7's migration feature to generate SQL equivalent to what these versions of Django would generate, helping us to stay compatible in the future. Not all of the Schema Editor support is public, and not all of the logic we need is even accessible, so we are forced to access private functions and re-implement logic here and there, but generally, it's pretty reasonable. Each of the newly-supported versions of Django generate SQL differently from older versions, and differently from each other. In some cases, these are enough where we have to actually compare against sample SQL datasets specific to certain versions of Django. This change is not sufficient to actually enable evolution for a project. It just brings API compatibility. The work to make evolutions and migrations work together will be a whole separate project.
Unit tests pass against Django 1.6, 1.7, 1.8, and 1.9 for SQLite,
MySQL, and Postgres.
Description | From | Last Updated |
---|---|---|
'get_model' imported but unused |
reviewbot | |
'get_models' imported but unused |
reviewbot | |
redefinition of unused 'OrderedDict' from line 20 |
reviewbot | |
redefinition of unused 'all_models' from line 21 |
reviewbot | |
'logging' imported but unused |
reviewbot | |
local variable 'e' is assigned to but never used |
reviewbot | |
local variable 'out_sql' is assigned to but never used |
reviewbot | |
'django' imported but unused |
reviewbot | |
'digest' imported but unused |
reviewbot | |
'supports_index_together' imported but unused |
reviewbot | |
local variable 'style' is assigned to but never used |
reviewbot | |
local variable 'creation' is assigned to but never used |
reviewbot | |
local variable 'creation' is assigned to but never used |
reviewbot | |
local variable 'style' is assigned to but never used |
reviewbot | |
local variable 'creation' is assigned to but never used |
reviewbot | |
local variable 'style' is assigned to but never used |
reviewbot | |
'get_model' imported but unused |
reviewbot | |
'Evolution' imported but unused |
reviewbot | |
'transaction' imported but unused |
reviewbot | |
'curry' imported but unused |
reviewbot | |
'clear_app_cache' imported but unused |
reviewbot | |
'apps' imported but unused |
reviewbot | |
'create_constraint_name' imported but unused |
reviewbot | |
'create_index_together_name' imported but unused |
reviewbot | |
There should be two blank lines between these. |
brennie | |
This blank line shouldn't be here. |
david | |
How about from django.utils.six.moves.cPickle import loads, dumps ? |
david | |
undefined name 'ImproperlyConfigured' |
reviewbot | |
undefined name 'ImproperlyConfigured' |
reviewbot | |
local variable 'e' is assigned to but never used |
reviewbot |
- Change Summary:
-
Fixed unused imports and variable declarations.
- Commit:
-
5f2119812a73a85ba24b39dea7b256fa61daed8b03a257ba6b5bd416530f63d903d8919c58f81134
- Diff:
-
Revision 2 (+1583 -307)
-
Tool: Pyflakes Processed Files: django_evolution/mutations.py django_evolution/tests/test_delete_field.py django_evolution/db/common.py django_evolution/compat/apps.py django_evolution/tests/test_index_together.py django_evolution/compat/db.py django_evolution/tests/test_database_sig.py django_evolution/tests/db/sqlite3.py django_evolution/tests/utils.py django_evolution/tests/test_add_field.py django_evolution/tests/db/postgresql.py django_evolution/db/mysql.py tests/runtests.py django_evolution/tests/test_preprocessing.py django_evolution/db/postgresql.py django_evolution/tests/db/mysql.py django_evolution/management/__init__.py django_evolution/compat/models.py
-
Tool: PEP8 Style Checker Processed Files: django_evolution/mutations.py django_evolution/tests/test_delete_field.py django_evolution/db/common.py django_evolution/compat/apps.py django_evolution/tests/test_index_together.py django_evolution/compat/db.py django_evolution/tests/test_database_sig.py django_evolution/tests/db/sqlite3.py django_evolution/tests/utils.py django_evolution/tests/test_add_field.py django_evolution/tests/db/postgresql.py django_evolution/db/mysql.py tests/runtests.py django_evolution/tests/test_preprocessing.py django_evolution/db/postgresql.py django_evolution/tests/db/mysql.py django_evolution/management/__init__.py django_evolution/compat/models.py
- Change Summary:
-
- Fixed
get_app
andget_apps
with apps that don't havemodels
modules. - Fixed
get_models
with non-existent modules. - Removed a blank line in imports.
- Fixed
- Diff:
-
Revision 3 (+1601 -307)
-
Tool: Pyflakes Processed Files: django_evolution/mutations.py django_evolution/tests/test_delete_field.py django_evolution/db/common.py django_evolution/compat/apps.py django_evolution/tests/test_index_together.py django_evolution/compat/db.py django_evolution/tests/test_database_sig.py django_evolution/tests/db/sqlite3.py django_evolution/tests/utils.py django_evolution/tests/test_add_field.py django_evolution/tests/db/postgresql.py django_evolution/db/mysql.py tests/runtests.py django_evolution/tests/test_preprocessing.py django_evolution/db/postgresql.py django_evolution/tests/db/mysql.py django_evolution/management/__init__.py django_evolution/compat/models.py Tool: PEP8 Style Checker Processed Files: django_evolution/mutations.py django_evolution/tests/test_delete_field.py django_evolution/db/common.py django_evolution/compat/apps.py django_evolution/tests/test_index_together.py django_evolution/compat/db.py django_evolution/tests/test_database_sig.py django_evolution/tests/db/sqlite3.py django_evolution/tests/utils.py django_evolution/tests/test_add_field.py django_evolution/tests/db/postgresql.py django_evolution/db/mysql.py tests/runtests.py django_evolution/tests/test_preprocessing.py django_evolution/db/postgresql.py django_evolution/tests/db/mysql.py django_evolution/management/__init__.py django_evolution/compat/models.py
-
-
-
- Change Summary:
-
- Fixed an unused variable in an exception handler.
- Added missing imports.
- Diff:
-
Revision 4 (+1602 -307)
-
Tool: Pyflakes Processed Files: django_evolution/mutations.py django_evolution/tests/test_delete_field.py django_evolution/db/common.py django_evolution/compat/apps.py django_evolution/tests/test_index_together.py django_evolution/compat/db.py django_evolution/tests/test_database_sig.py django_evolution/tests/db/sqlite3.py django_evolution/tests/utils.py django_evolution/tests/test_add_field.py django_evolution/tests/db/postgresql.py django_evolution/db/mysql.py tests/runtests.py django_evolution/tests/test_preprocessing.py django_evolution/db/postgresql.py django_evolution/tests/db/mysql.py django_evolution/management/__init__.py django_evolution/compat/models.py Tool: PEP8 Style Checker Processed Files: django_evolution/mutations.py django_evolution/tests/test_delete_field.py django_evolution/db/common.py django_evolution/compat/apps.py django_evolution/tests/test_index_together.py django_evolution/compat/db.py django_evolution/tests/test_database_sig.py django_evolution/tests/db/sqlite3.py django_evolution/tests/utils.py django_evolution/tests/test_add_field.py django_evolution/tests/db/postgresql.py django_evolution/db/mysql.py tests/runtests.py django_evolution/tests/test_preprocessing.py django_evolution/db/postgresql.py django_evolution/tests/db/mysql.py django_evolution/management/__init__.py django_evolution/compat/models.py