From b525124fdf6a0659f6e4b6d45c73231494a471c6 Mon Sep 17 00:00:00 2001 From: morty zhao Date: Fri, 12 Sep 2025 11:07:55 +0800 Subject: [PATCH] Fix special character password support in alembic (#811) --- backend/alembic/env.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/alembic/env.py b/backend/alembic/env.py index 5f3a45a4..3b7585f9 100644 --- a/backend/alembic/env.py +++ b/backend/alembic/env.py @@ -39,7 +39,9 @@ if alembic_config.config_file_name is not None: target_metadata = MappedBase.metadata # other values from the config, defined by the needs of env.py, -alembic_config.set_main_option('sqlalchemy.url', SQLALCHEMY_DATABASE_URL.render_as_string(hide_password=False)) +alembic_config.set_main_option( + 'sqlalchemy.url', SQLALCHEMY_DATABASE_URL.render_as_string(hide_password=False).replace('%', '%%') +) def run_migrations_offline():