Compare commits
No commits in common. "99d06baa0371f204f4de1e637d0725ac5ca111fa" and "530867bb160a4fb9b928f86c4b8705b7508716d4" have entirely different histories.
99d06baa03
...
530867bb16
@ -220,17 +220,10 @@ async def run_migrations():
|
|||||||
logger.info("Running database migrations...")
|
logger.info("Running database migrations...")
|
||||||
# Get the path to the alembic.ini file
|
# Get the path to the alembic.ini file
|
||||||
alembic_ini_path = os.path.join(os.path.dirname(__file__), '..', 'alembic.ini')
|
alembic_ini_path = os.path.join(os.path.dirname(__file__), '..', 'alembic.ini')
|
||||||
|
|
||||||
|
# Create Alembic configuration
|
||||||
alembic_cfg = Config(alembic_ini_path)
|
alembic_cfg = Config(alembic_ini_path)
|
||||||
|
|
||||||
# Set the script_location to the absolute path
|
|
||||||
script_location = os.path.join(os.path.dirname(__file__), '..', 'alembic')
|
|
||||||
alembic_cfg.set_main_option('script_location', script_location)
|
|
||||||
|
|
||||||
# Set the sqlalchemy.url
|
|
||||||
if not settings.DATABASE_URL:
|
|
||||||
raise ValueError("DATABASE_URL is not configured in settings.")
|
|
||||||
alembic_cfg.set_main_option('sqlalchemy.url', settings.DATABASE_URL)
|
|
||||||
|
|
||||||
# Run the migration
|
# Run the migration
|
||||||
command.upgrade(alembic_cfg, "head")
|
command.upgrade(alembic_cfg, "head")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user