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
The problem is, this assumes
IntegrationConfigwas installed in the
database prior to upgrade. That breaks upgrades from Review Board 2.5
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
DatabaseErrorto determine if tables existed
have been updated to use this mechanism. This leaves
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
Tested installing a new database.