Merge pull request #149 from JonasT/mysql-backend-autodetect
Add automatic rewrite of mysql:// database URLs to mysql+pymysql:// URLs. Since `pymysql` is the recommended way to use MySQL with Core, it makes sense to automatically rewrite the initial part of the `$DATABASE_URL` to `mysql+pymysql` .
This commit is contained in:
@@ -58,6 +58,12 @@ function setup_database () {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Translate mysql:// urls to mysql+mysql:// backend:
|
||||
if [[ "$DATABASE_URL" == mysql://* ]]; then
|
||||
DATABASE_URL="mysql+pymysql://${DATABASE_URL:8}"
|
||||
echo "Database URL was automatically rewritten to: $DATABASE_URL"
|
||||
fi
|
||||
|
||||
cat >> /etc/mailman.cfg <<EOF
|
||||
[database]
|
||||
class: $DATABASE_CLASS
|
||||
|
||||
Reference in New Issue
Block a user