fix(deploy): ensure /root/.pry dir and volume exist for SQLite migrations (#7)
All checks were successful
CI / lint (push) Successful in 46s
CI / typecheck (push) Successful in 1m35s
CI / test (push) Successful in 1m32s
CI / Security audit (bandit) (push) Successful in 2m24s
CI / Secret scan (gitleaks) (push) Successful in 2m51s

This commit is contained in:
Crypto Rug Munch 2026-07-03 02:46:17 +02:00
parent 07288a01d7
commit dec3db9618
3 changed files with 8 additions and 6 deletions

View file

@ -4,16 +4,15 @@ from logging.config import fileConfig
from sqlalchemy import engine_from_config, pool
from alembic import context
from db import Base
from db import Base, _resolve_database_url
config = context.config
if config.config_file_name is not None:
fileConfig(config.config_file_name)
db_url = os.getenv("PRY_DATABASE_URL")
if db_url is not None:
config.set_main_option("sqlalchemy.url", db_url)
# Always use the same URL resolution logic as the application.
config.set_main_option("sqlalchemy.url", os.getenv("PRY_DATABASE_URL") or _resolve_database_url())
target_metadata = Base.metadata
exclude_tables = {"spatial_ref_sys"}