Sha256: 0df4bbdc89f12c5e70083cd48a324e723427b170b2568ae592ff012248a5defb

Contents?: true

Size: 762 Bytes

Versions: 3

Compression:

Stored size: 762 Bytes

Contents

class CreateLolitaMenuItems < ActiveRecord::Migration
  def self.up
    create_table :lolita_menu_items, :force=>true do |t|
      t.string  :name
      t.string  :url
      t.integer :menu_id
      t.integer :lft
      t.integer :rgt
      t.integer :depth
      t.integer :parent_id
      t.boolean :is_visible
      t.timestamps
    end

    add_index :lolita_menu_items, :menu_id
    add_index :lolita_menu_items, [:lft,:rgt,:menu_id,:parent_id], :name => "lmi_lrmp"
    add_index :lolita_menu_items, :lft # for sorting
    add_index :lolita_menu_items, :rgt
    add_index :lolita_menu_items, :depth
    add_index :lolita_menu_items, :parent_id
    add_index :lolita_menu_items, :is_visible
  end

  def self.down
    drop_table :lolita_menu_items
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
lolita-menu-0.4.2 lib/generators/lolita/menu/templates/migrations/create_menu_items.rb
lolita-menu-0.4.1 lib/generators/lolita/menu/templates/migrations/create_menu_items.rb
lolita-menu-0.4.0 lib/generators/lolita/menu/templates/migrations/create_menu_items.rb