annotate lib/generators/redmine_plugin_model/templates/migration.rb @ 1115:433d4f72a19b redmine-2.2

Update to Redmine SVN revision 11137 on 2.2-stable branch
author Chris Cannam
date Mon, 07 Jan 2013 12:01:42 +0000
parents
children
rev   line source
Chris@1115 1 class <%= @migration_class_name %> < ActiveRecord::Migration
Chris@1115 2 def change
Chris@1115 3 create_table :<%= @table_name %> do |t|
Chris@1115 4 <% attributes.each do |attribute| -%>
Chris@1115 5 t.<%= attribute.type %> :<%= attribute.name %><%= attribute.inject_options %>
Chris@1115 6 <% end -%>
Chris@1115 7 <% if options[:timestamps] %>
Chris@1115 8 t.timestamps
Chris@1115 9 <% end -%>
Chris@1115 10 end
Chris@1115 11 <% attributes_with_index.each do |attribute| -%>
Chris@1115 12 add_index :<%= table_name %>, :<%= attribute.index_name %><%= attribute.inject_index_options %>
Chris@1115 13 <% end -%>
Chris@1115 14 end
Chris@1115 15 end