class SetupDiscuss < ActiveRecord::Migration

  def change
    create_table :discuss_messages do |t|
      t.string      :subject
      t.text        :body
      t.integer     :user_id, null: false
      t.string      :user_type
      t.string      :ancestry
      t.text        :draft_recipient_ids
      t.datetime    :sent_at
      t.datetime    :received_at
      t.datetime    :read_at
      t.datetime    :trashed_at
      t.datetime    :deleted_at
      t.boolean     :editable, default: true

      t.timestamps null: false
    end
    add_index :discuss_messages, [:user_type, :user_id]
    add_index :discuss_messages, :ancestry
  end
end

class SetupDiscuss < ActiveRecord::Migration[4.2]

  def change
    create_table :discuss_messages do |t|
      t.string      :subject
      t.text        :body
      t.integer     :user_id, null: false
      t.string      :user_type
      t.string      :ancestry
      t.text        :draft_recipient_ids
      t.datetime    :sent_at
      t.datetime    :received_at
      t.datetime    :read_at
      t.datetime    :trashed_at
      t.datetime    :deleted_at
      t.boolean     :editable, default: true

      t.timestamps null: false
    end
    add_index :discuss_messages, [:user_type, :user_id]
    add_index :discuss_messages, :ancestry
  end
end

Add Rails version tag to migration
Add Rails version tag to migration
