|
|
@ -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 |
|
|
|
try: |
|
|
|
app.log.info("Initializing EasyEngine Database") |
|
|
|
Base.metadata.create_all(bind=engine) |
|
|
|
except Exception as e: |
|
|
|
app.log.debug("{0}".format(e)) |
|
|
|