Update Django Evolution and add a dependency to fix new installs.
Review Request #11262 — Created Nov. 3, 2020 and submitted
Review Board 4.0 is the first release to use a version of Django with
the built-in migrations framework, which was incompatible with
evolutions. Django Evolution 2.0 was released to orchestrate new
database installs and upgrades that incorporated both evolutions and
migrations, but it had a flaw that broke new installs on Review Board.Basically, Django Evolution attempted to install initial migrations
first, then evolutions, and then any remaining migrations. However, the
oauth2_provider
app was a bit of a special case in that its initial
migration looks up a model that must be configured in settings by the
project to store project-specific information, and adds aForeignKey
to it. They require an initial migration for the project's model with a
reverse-dependency, set to run beforeoauth2_provider
's initial
migration.Django Evolution 2.1 further works around this by allowing evolutions to
specify dependencies and reverse-dependencies at both the app and
evolution levels, and generating the correct order of dependencies based
on that.We now depend on 2.1 for this functionality, and set the necessary
dependencies inreviewboard.oauth
to ensure that our model is created
beforeoauth2_provider
's migration is run, and to ensure that
reviewboard.site
is created beforereviewboard.oauth
(since the
model points to aLocalSite
, andreviewboard.site
would otherwise be
installed sometime afteroauth2_provider
in a different transaction.With this, it's now possible to install or upgrade a Review Board
database on all supported databases.
Successfully created a database on SQLite, MySQL, and Postgres.
Successfully upgraded a Review Board 3.0.19 database to 4.0 on
SQLite, MySQL, and Postgres.Unit tests pass (aside from a couple that were already failing).
Summary | ID |
---|---|
dd82c53b445fc5e5a9250b278738b37cf7ff27bf |