lib/generators/dust/albums/templates/migration/albums_migration.rb in dust-generators-0.2.6 vs lib/generators/dust/albums/templates/migration/albums_migration.rb in dust-generators-0.2.8

- old
+ new

@@ -1,39 +1,41 @@ class Create<%=parent_plural_class_name%> < ActiveRecord::Migration def self.up create_table :<%=parent_plural_name%> do |t| t.string :title - t.string :filename + t.string :filename t.text :desc - t.boolean :active - t.string :heading - t.string :nav - t.integer :position + t.boolean :active + t.string :heading + t.string :nav + t.integer :parent_id + t.integer :lft + t.integer :rgt t.timestamps end - - CmsMenuItem.create({:title =>"<%=parent_plural_class_name%>", :controller_name => "<%=parent_plural_name%>", :url => "/<%=parent_plural_name%>"}) - MenuItem.create({:title => "All <%=parent_plural_class_name%>", :url => "/all/<%=parent_plural_name%>", :active => true}) - - create_table :<%=child_plural_name%> do |t| + + CmsMenuItem.create({:title =>"<%=parent_plural_class_name%>", :controller_name => "<%=parent_plural_name%>", :url => "/<%=parent_plural_name%>"}) + MenuItem.create({:title => "All <%=parent_plural_class_name%>", :url => "/all/<%=parent_plural_name%>", :active => true}) + + create_table :<%=child_plural_name%> do |t| t.string :title t.text :desc t.date :date_shot t.string :location - t.integer :<%=parent_singular_name%>_id - t.string :file_file_name - t.string :file_content_type - t.integer :file_file_size - t.datetime :file_updated_at - t.integer :parent_id - t.integer :lft - t.integer :rgt + t.integer :<%=parent_singular_name%>_id + t.string :file_file_name + t.string :file_content_type + t.integer :file_file_size + t.datetime :file_updated_at + t.integer :parent_id + t.integer :lft + t.integer :rgt t.timestamps end - + end - + def self.down drop_table :<%=parent_plural_name%> - drop_table :<%=child_plural_name%> + drop_table :<%=child_plural_name%> end end