Avoid querying IntegrationConfig from older databases during upgrade.
Review Request #12772 — Created Jan. 6, 2023 and submitted
The database upgrade code looks for SCMTool-related state to migrate
over to SCMTool IDs, and one of the places where it looks is
IntegrationConfig
.The problem is, this assumes
IntegrationConfig
was installed in the
database prior to upgrade. That breaks upgrades from Review Board 2.5
and older.This change fixes up that assumption by first querying a list of all
known tables in the database as the first pre-upgrade step. Any code
that's sensitive to the presence of tables (ones that haven't been
around since 1.0) now checks for presence before doing anything that
would touch the database.Existing code that used
DatabaseError
to determine if tables existed
have been updated to use this mechanism. This leavesDatabaseError
free to bubble up, so we can catch other types of errors.
Tested upgrading from 2.5, 3.0, 4.0, and 5.0 databases using both
./reviewboard/manage.py
andrb-site upgrade
.Tested installing a new database.
Summary | ID |
---|---|
6c1ccef754829b784b6019ad0f6a666842623101 |