Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Commit

Permalink
manage uses sqlalchemy to get the list of tables instead of sql
Browse files Browse the repository at this point in the history
  • Loading branch information
anshukla committed Jul 26, 2016
1 parent 5bdb9fc commit 9391dc4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions manage.py
Original file line number Diff line number Diff line change
@@ -254,10 +254,10 @@ def create_all():
app = create_app(parse_options())
log = logging.getLogger(__name__)
with app.app_context():
tables_before = {t[0] for t in db.session.execute('SHOW TABLES')}
tables_before = db.engine.table_name()
db.create_all()
tables_after = {t[0] for t in db.session.execute('SHOW TABLES')}
created_tables = tables_after - tables_before
tables_after = db.engine.table_name()
created_tables = set(tables_after) - set(tables_before)
for table in created_tables:
log.info('Created table: {}'.format(table))

0 comments on commit 9391dc4

Please sign in to comment.