diff options
Diffstat (limited to 'generators/refinery_blog/templates')
-rw-r--r-- | generators/refinery_blog/templates/migration.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/generators/refinery_blog/templates/migration.rb b/generators/refinery_blog/templates/migration.rb index 2ebd06e..5ba29c6 100644 --- a/generators/refinery_blog/templates/migration.rb +++ b/generators/refinery_blog/templates/migration.rb @@ -1,16 +1,15 @@ class <%= migration_name %> < ActiveRecord::Migration def self.up<% tables.each do |table| %> - create_table :<%= table[:table_name] %> do |t| + create_table :<%= table[:table_name] %>, :id => <%= table[:id].to_s %> do |t| <% table[:attributes].each do |attribute| -%> t.<%= attribute.type %> :<%= attribute.name %> <% end -%> - t.timestamps + <%= 't.timestamps' if table[:id] %> end - add_index :<%= table[:table_name] %>, :id + <%= "add_index :#{table[:table_name]}, :id" if table[:id] %> <% end -%> - load(Rails.root.join('db', 'seeds', 'refinerycms_blog.rb').to_s) end |