class AddIndexToProjectAuthorizations < ActiveRecord::Migration
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    add_concurrent_index(:project_authorizations, :project_id)
  end

  def down
    remove_index(:project_authorizations, :project_id)
  end
end

class AddIndexToProjectAuthorizations < ActiveRecord::Migration
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    add_concurrent_index(:project_authorizations, :project_id)
  end

  def down
    remove_index(:project_authorizations, :project_id) if
      Gitlab::Database.postgresql?
  end
end

Drop the index only for postgresql, because
Drop the index only for postgresql, because

mysql cannot simply drop the index without dropping the corresponding
foreign key, and we certainly don't want to drop the foreign key
here.
