# An error occurred:
# --------
# Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for:
#
#   class AddSessionsTable < ActiveRecord::Migration[4.2]
# /Users/hidenori.matsuki/Creations/kontestapp/Kontest/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.0/lib/active_record/migration.rb:525:in `inherited'
# /Users/hidenori.matsuki/Creations/kontestapp/Kontest/db/migrate/20170521091558_add_sessions_table.rb:1:in `<top (required)>'
# --------
class AddSessionsTable < ActiveRecord::Migration[5.1]
  def change
    create_table :sessions do |t|
      t.string :session_id, :null => false
      t.text :data
      t.timestamps
    end

    add_index :sessions, :session_id, :unique => true
    add_index :sessions, :updated_at
  end
end
