From 3d70482029f4720b9033319bc8bafd4419c4c310 Mon Sep 17 00:00:00 2001 From: Maarten de Waard Date: Tue, 5 Apr 2022 12:11:38 +0200 Subject: [PATCH] try to add a Migrate call so we can migrate I hope --- app.py | 9 ++++----- areas/cliapp/cli.py | 2 -- database.py | 5 ----- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/app.py b/app.py index d6982de..8eccb79 100644 --- a/app.py +++ b/app.py @@ -1,6 +1,7 @@ from flask import Flask, jsonify -from flask_jwt_extended import JWTManager from flask_cors import CORS +from flask_jwt_extended import JWTManager +from flask_migrate import Migrate from jsonschema.exceptions import ValidationError from werkzeug.exceptions import BadRequest from flask_sqlalchemy import SQLAlchemy @@ -46,11 +47,9 @@ app.config["SQLALCHEMY_DATABASE_URI"] = SQLALCHEMY_DATABASE_URI #db = SQLAlchemy() 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(web) diff --git a/areas/cliapp/cli.py b/areas/cliapp/cli.py index 81421c8..32d65e3 100644 --- a/areas/cliapp/cli.py +++ b/areas/cliapp/cli.py @@ -24,8 +24,6 @@ import ory_kratos_client # Flask from flask import Flask, abort, redirect, render_template, request 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 areas import cli diff --git a/database.py b/database.py index 5c1c832..cc45acb 100644 --- a/database.py +++ b/database.py @@ -1,7 +1,2 @@ - - from flask_sqlalchemy import SQLAlchemy db = SQLAlchemy() - - -