From 53d845e0a0bd4fa567bc59f046a2974e4257a1e0 Mon Sep 17 00:00:00 2001 From: harshadyeola Date: Wed, 1 Apr 2015 18:03:12 +0530 Subject: [PATCH] updated parameter --- ee/core/database.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ee/core/database.py b/ee/core/database.py index 888dca38..0b44eac1 100644 --- a/ee/core/database.py +++ b/ee/core/database.py @@ -13,7 +13,7 @@ Base = declarative_base() Base.query = db_session.query_property() -def init_db(): +def init_db(app): """ Initializes and creates all tables from models into the database """ @@ -21,4 +21,8 @@ def init_db(): # they will be registered properly on the metadata. Otherwise # # you will have to import them first before calling init_db() # import ee.core.models - Base.metadata.create_all(bind=engine) + try: + app.log.info("Initializing EasyEngine Database") + Base.metadata.create_all(bind=engine) + except Exception as e: + app.log.debug("{0}".format(e))