-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix enumtables' table detection (#59)
### Description enumtables uses an empty select to detect the presence of tables. Unfortunately, as postgres wraps this whole process in a transaction, this can lead to situations where the tables are not detected properly. Here's how it goes wrong: 1. It gathers all the tables that are enums. 2. It tests for the existence of the tables. The first table check that fails will cause all subsequent operations in the transaction to fail, whether or not the operation is actually doable. 3. A lot of spurious table changes are "detected". This PR uses the table detection logic alembic internally uses (refactored for our needs), and this produces a changeset that makes sense. ### Test plan Autogenerated a schema migration with multiple enumtables. It produced the migration script.
- Loading branch information
Tony Tung
authored
Feb 9, 2021
1 parent
e1e8229
commit a5c4b13
Showing
1 changed file
with
43 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters