From 55658c5f23870c44f01754bfc0b8df8dffc7f361 Mon Sep 17 00:00:00 2001 From: Mathias Petermann Date: Fri, 16 Oct 2020 10:43:52 +0200 Subject: [PATCH] Add double % for escaped SQLALCHEMY_DATABASE_URI --- lemur/migrations/env.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lemur/migrations/env.py b/lemur/migrations/env.py index 3acefc3a..91fa5fcb 100644 --- a/lemur/migrations/env.py +++ b/lemur/migrations/env.py @@ -20,8 +20,9 @@ fileConfig(config.config_file_name) # target_metadata = mymodel.Base.metadata from flask import current_app +db_url_escaped = current_app.config.get('SQLALCHEMY_DATABASE_URI').replace('%', '%%') config.set_main_option( - "sqlalchemy.url", current_app.config.get("SQLALCHEMY_DATABASE_URI") + "sqlalchemy.url", db_url_escaped ) target_metadata = current_app.extensions["migrate"].db.metadata