diff --git a/build.gradle b/build.gradle index 4ddccb589..186fafd19 100644 --- a/build.gradle +++ b/build.gradle @@ -98,7 +98,15 @@ dependencies { compile "org.grails.plugins:mail:2.0.0.RC4" compile "org.grails.plugins:grails-spring-websocket:2.3.0" compile group: 'eu.bitwalker', name: 'UserAgentUtils', version: '1.20' - runtime 'mysql:mysql-connector-java:5.1.36' + runtime 'mysql:mysql-connector-java:8.0.12' + // runtime for postgresql works fine + // but compile group kept for testing as per closed pull request #368 + //compile group: 'org.postgresql', name: 'postgresql', version: '42.2.5' + //runtime 'org.postgresql:postgresql:42.2.5' + // as per instructions @ https://github.com/kaleidos/grails-postgresql-extensions/blob/master/README.md + // streama seems to work fine without it though + //compile 'org.grails.plugins:postgresql-extensions:6.1.0' + } task wrapper(type: Wrapper) { diff --git a/migration-scripts/mysql-table-user-to-users.sh b/migration-scripts/mysql-table-user-to-users.sh new file mode 100755 index 000000000..fcc8b4fc4 --- /dev/null +++ b/migration-scripts/mysql-table-user-to-users.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +# get streama database user name, password and DB name for mysql +echo input mysql user name for streama database: +read -s USER +echo '' +echo input mysql user password for streama database: +read -s PASS +echo '' +echo input mysql database name for streama database: +read -s DB +echo '' + +# check for 'user'/'users' table +if [ -z "$(mysql -u $USER --password=$PASS -D $DB -e "show tables like 'user'")" ]; then + echo "'user' table does not exist" + if [ -z "$(mysql -u $USER --password=$PASS -D $DB -e "show tables like 'users'")" ]; then + echo "'users' table does not exist either" + echo "there is an issue with your streama database" + else + echo "'users table exists'" + echo "no need to rename table" + fi + +else + echo "'user' table exists" + echo "renaming 'user' table to 'users'" + mysql -u $USER --password=$PASS -D $DB -e "ALTER TABLE user RENAME users" + if [ -z "$(mysql -u $USER --password=$PASS -D $DB -e "show tables like 'users'")" ]; then + echo "rename failed" + else + echo "rename succeeded" + fi + +fi + +echo "" +echo "finished"