Mercurial > public > develkit
diff init20.gradle @ 202:b217dc3b654a
USASR-1835: Attempt to fix quoting of database name in sql
author | Christopher Springer <springer@nwoca.org> |
---|---|
date | Fri, 21 Aug 2015 12:40:01 +0100 |
parents | e721a977726b |
children | a3c507b868a9 |
line wrap: on
line diff
--- a/init20.gradle Fri Aug 21 12:32:03 2015 +0100 +++ b/init20.gradle Fri Aug 21 12:40:01 2015 +0100 @@ -298,8 +298,8 @@ driverName) if (dropIt) { logger.info "disconnecting sessions from $databaseName" - sql.execute "REVOKE CONNECT ON DATABASE " + databaseName + " FROM public;" - sql.execute "REVOKE CONNECT ON DATABASE " + databaseName + " FROM " + gradle.environmentDatabase.jdbc.username + ";" + sql.execute "REVOKE CONNECT ON DATABASE \"" + databaseName + "\" FROM public;" + sql.execute "REVOKE CONNECT ON DATABASE \"" + databaseName + "\" FROM " + gradle.environmentDatabase.jdbc.username + ";" sql.execute "SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = '" + databaseName + "';" logger.info "dropping $databaseName (if exists) from $adminUrl" sql.execute 'DROP DATABASE IF EXISTS "' + databaseName + '";'