fix: properly escape postgres password (#3424)

Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
This commit is contained in:
tba-code 2024-04-08 09:47:57 -05:00 committed by GitHub
commit 92659c64eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 70 additions and 9 deletions

View file

@ -22,7 +22,11 @@ target_metadata = SqlAlchemyBase.metadata
# Set DB url from config
settings = get_app_settings()
config.set_main_option("sqlalchemy.url", settings.DB_URL)
if not settings.DB_URL:
raise Exception("DB URL not set in config")
config.set_main_option("sqlalchemy.url", settings.DB_URL.replace("%", "%%"))
def run_migrations_offline():