create all tables on startup

This commit is contained in:
Thomas Rubini 2023-02-11 22:42:46 +01:00
parent 653151c8bd
commit f4002b4ac7
No known key found for this signature in database
GPG Key ID: C7D287C8C1CAC373

View File

@ -19,9 +19,12 @@ class Database(SQLAlchemy):
database=os.getenv("DB_DBNAME")
)
app.config["SQLALCHEMY_DATABASE_URI"] = db_url
super().init_app(app)
with app.app_context():
self.create_all()
db = Database()
class Locale(db.Model):