Skip to content

Commit

Permalink
Merge pull request #5 from mlibrary/fix-sqlalchemy-connection-url
Browse files Browse the repository at this point in the history
Fix: Alembic needs a connection string
  • Loading branch information
niquerio authored Sep 25, 2024
2 parents 2cb8c17 + 85a3c57 commit 59e35a5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion aim/digifeeds/database/migrations/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
config = context.config

# Set url from environment variable
config.set_main_option("sqlalchemy.url", S.mysql_database)
config.set_main_option(
"sqlalchemy.url",
# This is for handling passwords with special characters
S.mysql_database.render_as_string(hide_password=False).replace("%", "%%"),
)

# Interpret the config file for Python logging.
# This line sets up loggers basically.
Expand Down
2 changes: 1 addition & 1 deletion compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ services:
environment:
- MARIADB_ROOT_PASSWORD=password
- MARIADB_USER=user
- MARIADB_PASSWORD=password
- MARIADB_PASSWORD=test@123
- MARIADB_DATABASE=database

volumes:
Expand Down
2 changes: 1 addition & 1 deletion env.development
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
MARIADB_ROOT_PASSWORD=password
MARIADB_USER=user
MARIADB_PASSWORD=password
MARIADB_PASSWORD=test@123
MARIADB_DATABASE=database
DATABASE_HOST=database

0 comments on commit 59e35a5

Please sign in to comment.