class CreateGithubIntegrations < ActiveRecord::Migration[5.2]
  def change
    create_table :github_integrations do |t|
      t.string :oauth_state
      t.text :access_token_ciphertext
      t.references :user, foreign_key: true, type: :integer, index: { unique: true }
      
      t.timestamps
    end
    add_index :github_integrations, :oauth_state, unique: true
  end
end

class CreateGithubIntegrations < ActiveRecord::Migration[5.0]
  def change
    create_table :github_integrations do |t|
      t.string :oauth_state
      t.text :access_token_ciphertext
      t.references :user, index: { unique: true }
      t.timestamps
    end
    add_index :github_integrations, :oauth_state, unique: true
    add_foreign_key(
      :github_integrations,
      :users,
      column: :user_id
    )
  end
end

Use an oldstyle migration so integer keys work
Use an oldstyle migration so integer keys work

Change the version of the github_integrations migration to 5.0 so that
the users_id column is an int and is compatible with extant user tables
