mirror of
https://github.com/skylanix/MamieHenriette.git
synced 2026-02-06 14:50:34 +01:00
13 lines
361 B
Python
13 lines
361 B
Python
from flask_sqlalchemy import SQLAlchemy
|
|
from sqlalchemy.sql import text
|
|
from webapp import webapp
|
|
|
|
webapp.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///database.db'
|
|
db = SQLAlchemy(webapp)
|
|
|
|
with webapp.app_context():
|
|
with open('database/schema.sql', 'r') as f:
|
|
sql_script = f.read()
|
|
db.session.execute(text(sql_script))
|
|
db.session.commit()
|