Skip to content

Commit f9fc6d2

Browse files
committed
Fix Alembic failure when MySQL passwords contain special characters
1 parent 5217c95 commit f9fc6d2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

backend/alembic/env.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@
3939
target_metadata = MappedBase.metadata
4040

4141
# other values from the config, defined by the needs of env.py,
42-
alembic_config.set_main_option('sqlalchemy.url', SQLALCHEMY_DATABASE_URL.render_as_string(hide_password=False))
42+
alembic_config.set_main_option(
43+
'sqlalchemy.url', SQLALCHEMY_DATABASE_URL.render_as_string(hide_password=False).replace('%', '%%')
44+
)
4345

4446

4547
def run_migrations_offline():

0 commit comments

Comments
 (0)