# HG changeset patch # User smith@nwoca.org # Date 1441051855 -3600 # Node ID a3c507b868a9e4d6b6ce1d674f4bfc867c93b722 # Parent e90ce1d50d859b2926f21c58519057b1377843d6# Parent b217dc3b654a98bee5e86f4b05a1ac063167d221 merge diff -r e90ce1d50d85 -r a3c507b868a9 init20.gradle --- a/init20.gradle Mon Aug 31 21:10:18 2015 +0100 +++ b/init20.gradle Mon Aug 31 21:10:55 2015 +0100 @@ -300,7 +300,9 @@ driverName) if (dropIt) { logger.info "disconnecting sessions from $databaseName" - sql.execute "SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = '$databaseName';" + 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 + '";' }