perf: improve perf in SIP-68 migration (#19416)

* chore: improve perf in SIP-68 migration

* Small fixes

* Create tables referenced in SQL

* Update logic in SqlaTable as well

* Fix unit tests
This commit is contained in:
Beto Dealmeida
2022-03-29 22:33:15 -07:00
committed by GitHub
parent 0968f86584
commit 63b5e2e4fa
9 changed files with 364 additions and 41 deletions

View File

@@ -102,7 +102,10 @@ def find_models(module: ModuleType) -> List[Type[Model]]:
while tables:
table = tables.pop()
seen.add(table)
model = getattr(Base.classes, table)
try:
model = getattr(Base.classes, table)
except AttributeError:
continue
model.__tablename__ = table
models.append(model)