summaryrefslogtreecommitdiff
path: root/ruby/destroy-all-user-dbs
diff options
context:
space:
mode:
Diffstat (limited to 'ruby/destroy-all-user-dbs')
-rwxr-xr-xruby/destroy-all-user-dbs14
1 files changed, 14 insertions, 0 deletions
diff --git a/ruby/destroy-all-user-dbs b/ruby/destroy-all-user-dbs
new file mode 100755
index 0000000..84cec56
--- /dev/null
+++ b/ruby/destroy-all-user-dbs
@@ -0,0 +1,14 @@
+#!/usr/bin/ruby
+
+require 'couchrest'
+
+server = CouchRest::Server.new
+
+server.databases.each do |db_name|
+ if db_name =~ /^user-[a-f0-9]{32}$/
+ server.database(db_name).delete!
+ end
+end
+
+
+