Enforce UTF-8 encoding when creating databases
We use InnoDB everywhere, so there should be no issues with long unicode keys. Dropped charset parameter for recreate_database since it's not needed anymore. Change-Id: Ib768402a9337c918309030a92ab81da17269f4f6
This commit is contained in:
+1
-2
@@ -43,9 +43,8 @@ function cleanup_database_mysql {
|
||||
|
||||
function recreate_database_mysql {
|
||||
local db=$1
|
||||
local charset=$2
|
||||
mysql -u$DATABASE_USER -p$DATABASE_PASSWORD -h$MYSQL_HOST -e "DROP DATABASE IF EXISTS $db;"
|
||||
mysql -u$DATABASE_USER -p$DATABASE_PASSWORD -h$MYSQL_HOST -e "CREATE DATABASE $db CHARACTER SET $charset;"
|
||||
mysql -u$DATABASE_USER -p$DATABASE_PASSWORD -h$MYSQL_HOST -e "CREATE DATABASE $db CHARACTER SET utf8;"
|
||||
}
|
||||
|
||||
function configure_database_mysql {
|
||||
|
||||
@@ -37,10 +37,9 @@ function cleanup_database_postgresql {
|
||||
|
||||
function recreate_database_postgresql {
|
||||
local db=$1
|
||||
local charset=$2
|
||||
# Avoid unsightly error when calling dropdb when the database doesn't exist
|
||||
psql -h$DATABASE_HOST -U$DATABASE_USER -dtemplate1 -c "DROP DATABASE IF EXISTS $db"
|
||||
createdb -h $DATABASE_HOST -U$DATABASE_USER -l C -T template0 -E $charset $db
|
||||
createdb -h $DATABASE_HOST -U$DATABASE_USER -l C -T template0 -E utf8 $db
|
||||
}
|
||||
|
||||
function configure_database_postgresql {
|
||||
|
||||
Reference in New Issue
Block a user