comparison init20.gradle @ 204:a3c507b868a9

merge
author smith@nwoca.org
date Mon, 31 Aug 2015 21:10:55 +0100
parents e90ce1d50d85 b217dc3b654a
children 55a2f489dbf7
comparison
equal deleted inserted replaced
203:e90ce1d50d85 204:a3c507b868a9
298 gradle.environmentDatabase.jdbc.username, 298 gradle.environmentDatabase.jdbc.username,
299 gradle.environmentDatabase.jdbc.password, 299 gradle.environmentDatabase.jdbc.password,
300 driverName) 300 driverName)
301 if (dropIt) { 301 if (dropIt) {
302 logger.info "disconnecting sessions from $databaseName" 302 logger.info "disconnecting sessions from $databaseName"
303 sql.execute "SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = '$databaseName';" 303 sql.execute "REVOKE CONNECT ON DATABASE \"" + databaseName + "\" FROM public;"
304 sql.execute "REVOKE CONNECT ON DATABASE \"" + databaseName + "\" FROM " + gradle.environmentDatabase.jdbc.username + ";"
305 sql.execute "SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = '" + databaseName + "';"
304 logger.info "dropping $databaseName (if exists) from $adminUrl" 306 logger.info "dropping $databaseName (if exists) from $adminUrl"
305 sql.execute 'DROP DATABASE IF EXISTS "' + databaseName + '";' 307 sql.execute 'DROP DATABASE IF EXISTS "' + databaseName + '";'
306 } 308 }
307 309
308 if (createIt) { 310 if (createIt) {