mirror of
https://github.com/MCMi460/3DS-RPC.git
synced 2025-06-18 13:35:34 -04:00
Ensure table metadata is passed to Alembic
This commit is contained in:
parent
6c7d738893
commit
e54133792c
@ -64,7 +64,7 @@ def run_migrations_offline():
|
||||
"""
|
||||
url = config.get_main_option("sqlalchemy.url")
|
||||
context.configure(
|
||||
url=url, target_metadata=get_metadata(), literal_binds=True
|
||||
url=url, literal_binds=True
|
||||
)
|
||||
|
||||
with context.begin_transaction():
|
||||
@ -98,7 +98,6 @@ def run_migrations_online():
|
||||
with connectable.connect() as connection:
|
||||
context.configure(
|
||||
connection=connection,
|
||||
target_metadata=get_metadata(),
|
||||
**conf_args
|
||||
)
|
||||
|
||||
|
@ -7,7 +7,7 @@ import sys, datetime, xmltodict, pickle, secrets
|
||||
|
||||
from sqlalchemy import select, update, insert, delete
|
||||
|
||||
from database import start_db_time, get_db_url, Friend, DiscordFriends, Discord, Config
|
||||
from database import *
|
||||
|
||||
sys.path.append('../')
|
||||
from api.love2 import *
|
||||
@ -22,7 +22,10 @@ app.config["SQLALCHEMY_DATABASE_URI"] = get_db_url()
|
||||
db = SQLAlchemy()
|
||||
db.init_app(app)
|
||||
|
||||
migrate = Migrate(app, db)
|
||||
# We need to manually specify our base model's metadata after
|
||||
# importing all other models using it as the declarative base.
|
||||
# (See above with `from database import *`)
|
||||
migrate = Migrate(app, db, target_metadata=Base.metadata)
|
||||
|
||||
limiter = Limiter(app, key_func=lambda: request.access_route[-1])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user