class GodmodeCreateAwesomeNestedSetCategory

Public Instance Methods

change() click to toggle source
# File lib/generators/godmode/templates/category/awesome_nested_set/migration.rb, line 3
def change
  drop_table :categories
  create_table :categories do |t|
    t.string :name
    t.integer :parent_id
    t.integer :lft
    t.integer :rgt
    t.integer :depth 

    t.timestamps
  end
  add_index :categories, :parent_id
  add_index :categories, :rgt
end