Skip to content

Commit

Permalink
Check if DB initialized before creating tables from models
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-c committed Apr 28, 2017
1 parent 8aed550 commit 1ab99dc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ def sync():
To re/create the database, [delete and] create within the DBMS itself,
then invoke this function.
"""
db.create_all()
if not db.engine.dialect.has_table(db.engine.connect(), 'alembic_version'):
db.create_all()
stamp_db()
upgrade_db()
seed(include_interventions=True)
Expand Down

0 comments on commit 1ab99dc

Please sign in to comment.