1
Fork 0
mirror of https://github.com/Steffo99/greed.git synced 2024-11-24 23:04:18 +00:00

🐛 Fix database table creation

This commit is contained in:
Steffo 2020-09-11 01:38:37 +02:00
parent 3d095afcff
commit 46449d6168

View file

@ -76,12 +76,12 @@ def main():
# Create the database engine
log.debug("Creating the sqlalchemy engine...")
engine = sqlalchemy.create_engine(user_cfg["Database"]["engine"])
log.debug("Preparing the tables through deferred reflection...")
sed.DeferredReflection.prepare(engine)
log.debug("Binding metadata to the engine...")
database.TableDeclarativeBase.metadata.bind = engine
log.debug("Creating all missing tables...")
database.TableDeclarativeBase.metadata.create_all()
log.debug("Preparing the tables through deferred reflection...")
sed.DeferredReflection.prepare(engine)
# Create a bot instance
bot = duckbot.factory(user_cfg)()