Skip to content

Commit

Permalink
Rewrite DATABASE_URL when it starts with mysql://
Browse files Browse the repository at this point in the history
DATABASE_URL precedence over database/config.yml, so DATABASE_URL has to have a valid adapter name for Rails.
  • Loading branch information
knu committed Jan 23, 2022
1 parent ce9436c commit c682743
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docker/scripts/setup_env
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ fi
if [[ -n "$DATABASE_URL" ]]; then
case "${DATABASE_URL%%://*}" in
mysql)
DATABASE_ADAPTER=mysql2 ;;
DATABASE_ADAPTER=mysql2
DATABASE_URL="$DATABASE_ADAPTER${DATABASE_URL#mysql}" ;;
postgres)
DATABASE_ADAPTER=postgresql ;;
*)
Expand Down

0 comments on commit c682743

Please sign in to comment.