Add a RenameModel mutation for handling model renames.

Review Request #6216 — Created Aug. 12, 2014 and submitted

Information

Django Evolution
master
dce0e20...

Reviewers

The new RenameModel mutation allows an evolution to indicate that a
model has been renamed. This handles updating the signature for any
related ForeignKeys or ManyToManyFields and generating any SQL to
perform the table rename (if needed).

For the unit tests, some work was needed to allow models to be added
before the base test model, in order for model creation/destruction to
happen in the right orders.

Unit tests for sqlite3, MySQL (InnoDB and MyISAM), and Postgres all pass.

Hand-tested against my sqlite3 database and a copy of a production MySQL
database using InnoDB.

reviewbot
  1. Tool: Pyflakes
    Processed Files:
        django_evolution/mutations.py
        django_evolution/tests/base_test_case.py
        django_evolution/tests/test_rename_model.py
        django_evolution/tests/db/sqlite3.py
        django_evolution/tests/db/postgresql.py
        django_evolution/tests/test_rename_field.py
        django_evolution/tests/db/mysql.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        django_evolution/mutations.py
        django_evolution/tests/base_test_case.py
        django_evolution/tests/test_rename_model.py
        django_evolution/tests/db/sqlite3.py
        django_evolution/tests/db/postgresql.py
        django_evolution/tests/test_rename_field.py
        django_evolution/tests/db/mysql.py
    
    
  2. 
      
david
  1. Ship It!

  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Loading...