Skip to content

Commit

Permalink
fix: remove alembic table
Browse files Browse the repository at this point in the history
  • Loading branch information
Aydawka committed Jun 28, 2024
1 parent 4a26fa9 commit 3e4bfd4
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from flask_bcrypt import Bcrypt
from flask_cors import CORS
from growthbook import GrowthBook
from sqlalchemy import MetaData, inspect
from sqlalchemy import MetaData, inspect, text
from sqlalchemy.ext.compiler import compiles
from sqlalchemy.schema import DropTable
from waitress import serve
Expand Down Expand Up @@ -132,10 +132,9 @@ def destroy_schema():
if config.FAIRHUB_DATABASE_URL.find("azure") > -1:
return
engine = model.db.session.get_bind()
with engine.begin():
with engine.begin() as conn:
model.db.drop_all()
# conn.execute(text("DROP TABLE IF EXISTS alembic_version"))

conn.execute(text("DROP TABLE IF EXISTS alembic_version")) # type: ignore
@app.cli.command("cycle-schema")
def cycle_schema():
"""Destroy then re-create the database schema."""
Expand Down Expand Up @@ -260,7 +259,7 @@ def on_after_request(resp):
)

new_token = jwt.encode(
{"user": decoded["user"], "exp": expired_in, "jti": decoded["jti"]},
{"user": decoded["user"], "exp": expired_in, "jti": decoded["jti"]},
config.FAIRHUB_SECRET,
algorithm="HS256",
)
Expand Down

0 comments on commit 3e4bfd4

Please sign in to comment.