• 
      

    Use Django Evolution 2.0's new Evolver for extension database management.

    Review Request #10602 — Created June 19, 2019 and submitted

    Information

    Djblets
    release-2.0.x

    Reviewers

    Django Evolution 2.0 introduces a new Evolver class for
    programmatically synchronizing models to the database and applying
    evolutions and migrations. This is now required by Djblets if the
    extension framework at all wants to allow for extensions with models.

    This replaces shelling out to syncdb/migrate and evolve,
    simplifying our code considerably and letting Django Evolution handle
    all the hard parts.

    It also has a very strong advantage of only managing the apps owned by
    the extension, preventing any other apps from ever being affected.
    Previously, if there was a new model or evolution introduced somewhere
    (by another app, or by Review Board itself), it woud have been
    synced/evolved as well, which posed problems at times. Now that we have
    greater control, changes to the database (and the stored project
    signature) will be minimized.

    Unit tests have been updated to work with the new Django Evolution APIs,
    and to assume that Django Evolution is present for tests (since we
    include this in dev-requirements.txt).

    The dependency version has been bumped as well, currently requiring that
    the version in the Django Evolution master branch in Git be installed.

    Unit tests pass on Django 1.6 and 1.11.

    Summary ID
    Use Django Evolution 2.0's new Evolver for extension database management.
    Django Evolution 2.0 introduces a new `Evolver` class for programmatically synchronizing models to the database and applying evolutions and migrations. This is now required by Djblets if the extension framework at all wants to allow for extensions with models. This replaces shelling out to `syncdb`/`migrate` and `evolve`, simplifying our code considerably and letting Django Evolution handle all the hard parts. It also has a very strong advantage of *only* managing the apps owned by the extension, preventing any other apps from ever being affected. Previously, if there was a new model or evolution introduced somewhere (by another app, or by Review Board itself), it woud have been synced/evolved as well, which posed problems at times. Now that we have greater control, changes to the database (and the stored project signature) will be minimized. Unit tests have been updated to work with the new Django Evolution APIs, and to assume that Django Evolution is present for tests (since we include this in `dev-requirements.txt`). The dependency version has been bumped as well, currently requiring that the version in the Django Evolution `master` branch in Git be installed.
    066c61dd295e2a520ab03df5ea015abd9c9a4a5a
    david
    1. Ship It!
    2. 
        
    chipx86
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-2.0.x (5d4e867)