added sql to move to utf8
authorLisa Marie Maginnis <lisam@fsf.org>
Sun, 28 Feb 2016 07:23:29 +0000 (02:23 -0500)
committerLisa Marie Maginnis <lisam@fsf.org>
Sun, 28 Feb 2016 07:23:29 +0000 (02:23 -0500)
files/etc/init.d/install-mediagoblin/DEFAULT

index 0b3986f8ac4148854130a8f27d0ab849d12e4f00..dcf7e8eb57ce0dbe48c04fbdf55514a05e16f455 100755 (executable)
@@ -4,6 +4,12 @@ cd GMG_PATH_TOKEN
 if [ ! -d mediagoblin ]; then
 
     # Create the GMG user
+    sudo -u poostgres psql -c "UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1'"
+    sudo -u poostgres psql -c "DROP DATABASE template1"
+    sudo -u poostgres psql -c "CREATE DATABASE template1 WITH TEMPLATE = template0 ENCODING='UNICODE' LC_COLLATE='en_US.UTF8' LC_CTYPE='en_US.UTF8'"
+    sudo -u poostgres psql -c "UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template1'"
+    sudo -u poostgres psql -c "UPDATE pg_database SET datallowconn = FALSE WHERE datname = 'template1'"
+
     sudo -u postgres createuser -A -D mediagoblin
     # Crea te GMG database
     sudo -u postgres createdb -E UNICODE -O mediagoblin mediagoblin