Don't use error handling to determine if tables exist.

Review Request #11236 — Created Oct. 20, 2020 and submitted

Information

Django Evolution
master

Reviewers

When Evolver sets itself up, it looks for the presence of a Version
table, falling back on bootstrapping if it doesn't exist. This was done
by attempting a direct query and then initiating bootstrap if no
Version items were present or if the table itself didn't exist in the
database.

Handling this by watching for an error isn't ideal, and can impact any
parent transaction, or obscure other issues. Instead, the better
approach is to look to see if the table exists in the database directly.

This change implements that, and takes care of a similar type of check
in one of the Evolver unit tests.

Unit tests pass for all databases.

Summary ID
Don't use error handling to determine if tables exist.
When `Evolver` sets itself up, it looks for the presence of a `Version` table, falling back on bootstrapping if it doesn't exist. This was done by attempting a direct query and then initiating bootstrap if no `Version` items were present or if the table itself didn't exist in the database. Handling this by watching for an error isn't ideal, and can impact any parent transaction, or obscure other issues. Instead, the better approach is to look to see if the table exists in the database directly. This change implements that, and takes care of a similar type of check in one of the `Evolver` unit tests.
ac6ca2ed200c399c2c30d51e39b4fef11e23ad82
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to master (25f4401)