Prevent attempting to create/delete indexes unnecessarily.
Review Request #7164 — Created April 4, 2015 and submitted
If the db_index parameter was set to True and an index already existed in the databse, or it was set to False and an index didn't exist in the database, we'd still generate the SQL for the index change, leading to errors. We now do a better job of detecting whether we actually need to create/delete the index. Unit tests were added to ensure this works across databases.
Unit tests pass on all databases.
Solved a problem I was hitting with a real-world database.
- Change Summary:
-
Fixed unused imports.
- Commit:
-
274a78e4aa1f31c3ca2f4e7b9dd33d264d6300767190ba0853d3168e4bf9b1611ccb470127a5ce6f
-
Tool: Pyflakes Processed Files: django_evolution/tests/db/postgresql.py django_evolution/db/common.py django_evolution/tests/db/sqlite3.py django_evolution/tests/test_change_field.py django_evolution/tests/db/mysql.py Tool: PEP8 Style Checker Processed Files: django_evolution/tests/db/postgresql.py django_evolution/db/common.py django_evolution/tests/db/sqlite3.py django_evolution/tests/test_change_field.py django_evolution/tests/db/mysql.py