summaryrefslogtreecommitdiff
path: root/ruby/destroy-all-user-dbs
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2015-08-20 22:21:51 -0700
committerelijah <elijah@riseup.net>2015-08-20 22:21:51 -0700
commit9b64c2897bff6121e854a7a39351e1398085e2b0 (patch)
tree6787badfc5b1aa2445cf1f444d9091223babf82c /ruby/destroy-all-user-dbs
parenta98988509db855d151d180f864191682caddf400 (diff)
added script to delete test users
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
+
+
+