Selaa lähdekoodia

feat(sqlalchemy): add missing file

Jonathan Rohde 10 kuukautta sitten
vanhempi
commit
2fb27adbf6
1 muutettua tiedostoa jossa 9 lisäystä ja 0 poistoa
  1. 9 0
      backend/migrations/util.py

+ 9 - 0
backend/migrations/util.py

@@ -0,0 +1,9 @@
+from alembic import op
+from sqlalchemy import Inspector
+
+
+def get_existing_tables():
+    con = op.get_bind()
+    inspector = Inspector.from_engine(con)
+    tables = set(inspector.get_table_names())
+    return tables