From 3dae0861000f7e0c03b3ab61c0ad6537259a3192 Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Thu, 7 Oct 2021 09:30:54 +0300 Subject: [PATCH] Add `alembic.ini` (#10053) The `url` setting was unused - it should be `sqlalchemy.url`, and the DB is set up in `env.py`. --- warehouse/db.py | 4 +--- warehouse/migrations/alembic.ini | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 warehouse/migrations/alembic.ini diff --git a/warehouse/db.py b/warehouse/db.py index 1ef65c266b96..af62fd75b1b2 100644 --- a/warehouse/db.py +++ b/warehouse/db.py @@ -131,9 +131,7 @@ def callback(scanner, _name, wrapped): def _configure_alembic(config): - alembic_cfg = alembic.config.Config() - alembic_cfg.set_main_option("script_location", "warehouse:migrations") - alembic_cfg.set_main_option("url", config.registry.settings["database.url"]) + alembic_cfg = alembic.config.Config("warehouse/migrations/alembic.ini") return alembic_cfg diff --git a/warehouse/migrations/alembic.ini b/warehouse/migrations/alembic.ini new file mode 100644 index 000000000000..82fc2a4a18ab --- /dev/null +++ b/warehouse/migrations/alembic.ini @@ -0,0 +1,2 @@ +[alembic] +script_location = warehouse:migrations