Sha256: 44567e44c3b35d4016e6409abddaaa10be15ab94a692140d1e7e0849866b270e

Contents?: true

Size: 1.22 KB

Versions: 19

Compression:

Stored size: 1.22 KB

Contents

class CreateEffectivePages < ActiveRecord::Migration[4.2]
  def self.up
    create_table <%= @pages_table_name %> do |t|
      t.string :title
      t.string :meta_description

      t.boolean :draft, :default => false

      t.string :layout, :default => 'application'
      t.string :template

      t.string :slug
      t.integer :roles_mask, :default => 0

      t.datetime :updated_at
      t.datetime :created_at
    end
    add_index <%= @pages_table_name %>, :slug, :unique => true

    create_table <%= @menus_table_name %> do |t|
      t.string      :title
      t.timestamps
    end

    create_table <%= @menu_items_table_name %> do |t|
      t.integer       :menu_id

      t.integer       :menuable_id
      t.string        :menuable_type

      t.string        :title

      t.string        :url
      t.string        :special

      t.string        :classes
      t.boolean       :new_window, :default => false
      t.integer       :roles_mask, :default => nil

      t.integer       :lft
      t.integer       :rgt
    end
    add_index <%= @menu_items_table_name %>, :lft
  end

  def self.down
    drop_table <%= @pages_table_name %>
    drop_table <%= @menus_table_name %>
    drop_table <%= @menu_items_table_name %>
  end

end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
effective_pages-1.3.2 db/migrate/01_create_effective_pages.rb.erb
effective_pages-1.3.1 db/migrate/01_create_effective_pages.rb.erb
effective_pages-1.3.0 db/migrate/01_create_effective_pages.rb.erb
effective_pages-3.0.0 db/migrate/01_create_effective_pages.rb.erb
effective_pages-2.1.0 db/migrate/01_create_effective_pages.rb.erb
effective_pages-2.0.9 db/migrate/01_create_effective_pages.rb.erb
effective_pages-2.0.8 db/migrate/01_create_effective_pages.rb.erb
effective_pages-2.0.7 db/migrate/01_create_effective_pages.rb.erb
effective_pages-1.2.0 db/migrate/01_create_effective_pages.rb.erb
effective_pages-2.0.6 db/migrate/01_create_effective_pages.rb.erb
effective_pages-2.0.5 db/migrate/01_create_effective_pages.rb.erb
effective_pages-2.0.4 db/migrate/01_create_effective_pages.rb.erb
effective_pages-2.0.3 db/migrate/01_create_effective_pages.rb.erb
effective_pages-2.0.2 db/migrate/01_create_effective_pages.rb.erb
effective_pages-2.0.1 db/migrate/01_create_effective_pages.rb.erb
effective_pages-1.1.9 db/migrate/01_create_effective_pages.rb.erb
effective_pages-2.0.0 db/migrate/01_create_effective_pages.rb.erb
effective_pages-1.1.8 db/migrate/01_create_effective_pages.rb.erb
effective_pages-1.1.7 db/migrate/01_create_effective_pages.rb.erb