CartoDB/cartodb — pull request #557 by strk (2014-06-26 07:42:23+00:00)
Title: Add cartodb:db:unregister_extraneous_cartodb_members rake task

The task fixes databases that switched to "cartodb" extension
landing to versions before 0.2.1. At that time any table found
in the database with a cartodb trigger on it would have been
re-cartodbfied, effectively tagging any newly created object
as being part of the extension itself, so that it's not possible
to drop by itself.

This task tries at cleaning up that mess by de-registering those
extraneous objects from being part of the extension.

In its current incarnation it only expects extraneous objects to
be of the "pg_class" type, as that's the only ones we found on
the field.

The rake task arguments are: host, sleep, dry-run.
By default it runs againt all database hosts and in dry-run mode.
You should see NOTICEs dumped on stdout with a detail of the queries
that would be run (NOTE: those NOTICEs will not end in the log)