Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Alembic needs a connection string #5

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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