class CreateEffectiveRegions < ActiveRecord::Migration[4.2] def self.up create_table <%= @regions_table_name %> do |t| t.string :regionable_type t.integer :regionable_id t.string :title t.text :content t.text :snippets t.datetime :updated_at t.datetime :created_at end create_table <%= @ck_assets_table_name %> do |t| t.boolean :global, default: false t.datetime :updated_at t.datetime :created_at end add_index <%= @regions_table_name %>, [:regionable_type, :regionable_id] add_index <%= @regions_table_name %>, :regionable_id end def self.down drop_table <%= @regions_table_name %> end end