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

Commit

Permalink
Merge pull request #6 from anshukla/master
Browse files Browse the repository at this point in the history
Manage uses SQLAlchemy to get the list of tables instead of a SQL query.
  • Loading branch information
Robpol86 authored Jul 26, 2016
2 parents 5bdb9fc + 8185648 commit f536c3d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,9 @@ 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 = set(db.engine.table_names())
db.create_all()
tables_after = {t[0] for t in db.session.execute('SHOW TABLES')}
tables_after = set(db.engine.table_names())
created_tables = tables_after - tables_before
for table in created_tables:
log.info('Created table: {}'.format(table))
Expand Down

0 comments on commit f536c3d

Please sign in to comment.