Skip to content

Commit

Permalink
try drop/create broker db
Browse files Browse the repository at this point in the history
  • Loading branch information
alex75 committed Jan 17, 2024
1 parent 838936f commit ec0657f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cads_broker/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,8 @@ def init_database(connection_string: str, force: bool = False) -> sa.engine.Engi
if not sqlalchemy_utils.database_exists(engine.url):
sqlalchemy_utils.create_database(engine.url)
# cleanup and create the schema
cacholote.database.Base.metadata.drop_all(engine)
cacholote.database.Base.metadata.create_all(engine)
BaseModel.metadata.drop_all(engine)
BaseModel.metadata.create_all(engine)
alembic.command.stamp(alembic_cfg, "head")
Expand Down

0 comments on commit ec0657f

Please sign in to comment.