Mercurial > hg > soundsoftware-site
diff lib/generators/redmine_plugin_model/templates/migration.rb.erb @ 0:513646585e45
* Import Redmine trunk SVN rev 3859
author | Chris Cannam |
---|---|
date | Fri, 23 Jul 2010 15:52:44 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/generators/redmine_plugin_model/templates/migration.rb.erb Fri Jul 23 15:52:44 2010 +0100 @@ -0,0 +1,13 @@ +class <%= migration_name %> < ActiveRecord::Migration + def self.up + create_table :<%= table_name %> do |t| +<% for attribute in attributes -%> + t.column :<%= attribute.name %>, :<%= attribute.type %> +<% end -%> + end + end + + def self.down + drop_table :<%= table_name %> + end +end