1
Fork 0
mirror of https://github.com/Steffo99/greed.git synced 2024-11-22 05:54: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 # Create the database engine
log.debug("Creating the sqlalchemy engine...") log.debug("Creating the sqlalchemy engine...")
engine = sqlalchemy.create_engine(user_cfg["Database"]["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...") log.debug("Binding metadata to the engine...")
database.TableDeclarativeBase.metadata.bind = engine database.TableDeclarativeBase.metadata.bind = engine
log.debug("Creating all missing tables...") log.debug("Creating all missing tables...")
database.TableDeclarativeBase.metadata.create_all() database.TableDeclarativeBase.metadata.create_all()
log.debug("Preparing the tables through deferred reflection...")
sed.DeferredReflection.prepare(engine)
# Create a bot instance # Create a bot instance
bot = duckbot.factory(user_cfg)() bot = duckbot.factory(user_cfg)()