Sha256: 14f28fd6facdabf71543abc08327e470eabdd98d8eadf2450121670f5270793c

Contents?: true

Size: 1.23 KB

Versions: 3

Compression:

Stored size: 1.23 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.boolean :authenticate_user, default: false
      t.integer :roles_mask, default: 0

      t.integer :menu_parent_id

      t.boolean :menu, default: false

      t.string :menu_name
      t.string :menu_group

      t.string :menu_title
      t.string :menu_url
      t.integer :menu_position

      t.datetime :updated_at
      t.datetime :created_at
    end

    add_index <%= @pages_table_name %>, :slug, :unique => true

    create_table <%= @page_sections_table_name %> do |t|
      t.string :owner_type
      t.integer :owner_id

      t.string :name

      t.string :title
      t.string :caption

      t.string :link_label
      t.string :link_url

      t.text :hint

      t.datetime :updated_at
      t.datetime :created_at
    end

    add_index <%= @page_sections_table_name %>, :name, :unique => true
  end

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

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
effective_pages-3.3.2 db/migrate/01_create_effective_pages.rb.erb
effective_pages-3.3.1 db/migrate/01_create_effective_pages.rb.erb
effective_pages-3.3.0 db/migrate/01_create_effective_pages.rb.erb