Created
January 17, 2020 20:14
-
-
Save tgaff/ca7a053fbab66fa85b6b1ace30b213b7 to your computer and use it in GitHub Desktop.
Update elasticbeanstalk eb db url with utf8mb4 encoding and utf8mb4_unicode_ci collation - requires manual string edit!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set +e | |
eb use $1 | |
echo $1 | |
eb printenv | grep DATABASE_URL | |
URL=`eb printenv | grep DATABASE_URL | sed -e 's/^[ \t]*//'` | |
echo "Using the above URL" | |
echo " you need to add '?encoding=utf8mb4&collation=utf8mb4_unicode_ci' to the end and format the params properly if others are already there" | |
echo " Then run eb setenv \"DATABASE_URL=<the-new-url>\"" | |
echo | |
echo | |
echo "Template:" | |
echo "eb setenv \"${URL} + ?encoding=utf8mb4&collation=utf8mb4_unicode_ci\"" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment