# \[ANN\] add\_downs, plugin to help writing 'down' methods

**URL:** <https://www.ruby-forum.com/t/ann-add-downs-plugin-to-help-writing-down-methods/135485>\
**Category:** Rails\
**Created:** [April 22, 2008, 5:08pm UTC](https://www.ruby-forum.com/t/ann-add-downs-plugin-to-help-writing-down-methods/135485 "2008-04-22T17:08:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_ASBlack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b4bc9f/32.png) [@David\_ASBlack](https://www.ruby-forum.com/u/David_ASBlack)\
**Post date:** [April 22, 2008, 5:08pm UTC](https://www.ruby-forum.com/t/ann-add-downs-plugin-to-help-writing-down-methods/135485/1 "2008-04-22T17:08:49Z")

</div>

Hi –

I’ve written a little plugin, partly just for fun (though there’s no  
reason it couldn’t be useful), called add\_downs, which lets you do  
this:

rake db:migrate:add\_downs

and end up with your migrations with their down methods written  
automatically.

The way it works is that it overrides create\_table, add\_column, etc.,  
so that they print out their opposites, and then it executes your up  
methods. It doesn’t connect to the database, so it can’t reverse  
certain operations involving column type.

Overall it’s mostly for simple-ish cases, but could be handy. You can  
find it at: [http://www.risleydale.net/svn/plugins/add\_downs](http://www.risleydale.net/svn/plugins/add_downs)

David

–  
Rails training from David A. Black and Ruby Power and Light:  
INTRO TO RAILS June 9-12 Berlin  
ADVANCING WITH RAILS June 16-19 Berlin  
INTRO TO RAILS June 24-27 London (Skills Matter)  
See [http://www.rubypal.com](http://www.rubypal.com) for details and updates!
