try to add a Migrate call so we can migrate I hope

This commit is contained in:
Maarten de Waard 2022-04-05 12:11:38 +02:00
parent 2564f3aae6
commit 3d70482029
No known key found for this signature in database
GPG key ID: 1D3E893A657CC8DA
3 changed files with 4 additions and 12 deletions

9
app.py
View file

@ -1,6 +1,7 @@
from flask import Flask, jsonify from flask import Flask, jsonify
from flask_jwt_extended import JWTManager
from flask_cors import CORS from flask_cors import CORS
from flask_jwt_extended import JWTManager
from flask_migrate import Migrate
from jsonschema.exceptions import ValidationError from jsonschema.exceptions import ValidationError
from werkzeug.exceptions import BadRequest from werkzeug.exceptions import BadRequest
from flask_sqlalchemy import SQLAlchemy from flask_sqlalchemy import SQLAlchemy
@ -46,11 +47,9 @@ app.config["SQLALCHEMY_DATABASE_URI"] = SQLALCHEMY_DATABASE_URI
#db = SQLAlchemy() #db = SQLAlchemy()
db.init_app(app) db.init_app(app)
# Late beceuse of circular import Migrate(app, db)
##
app.logger.setLevel(logging.INFO)
app.logger.setLevel(logging.INFO)
app.register_blueprint(api_v1) app.register_blueprint(api_v1)
app.register_blueprint(web) app.register_blueprint(web)

View file

@ -24,8 +24,6 @@ import ory_kratos_client
# Flask # Flask
from flask import Flask, abort, redirect, render_template, request from flask import Flask, abort, redirect, render_template, request
from flask.cli import AppGroup from flask.cli import AppGroup
from flask_migrate import Migrate
from flask_sqlalchemy import SQLAlchemy
from ory_kratos_client.api import v0alpha2_api as kratos_api from ory_kratos_client.api import v0alpha2_api as kratos_api
from areas import cli from areas import cli

View file

@ -1,7 +1,2 @@
from flask_sqlalchemy import SQLAlchemy from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy() db = SQLAlchemy()