defmodule BorsNG.Database.Repo.Migrations.ChangeUsersLoginTypeToCitext do
  use Ecto.Migration

  def up do
    execute "CREATE EXTENSION IF NOT EXISTS citext"

    alter table(:users) do
      modify :login, :citext
    end
  end

  def down do
    alter table(:users) do
      modify :login, :string
    end

    execute "DROP EXTENSION citext"
  end
end

defmodule BorsNG.Database.Repo.Migrations.ChangeUsersLoginTypeToCitext do
  use Ecto.Migration

  @adapter Application.get_env(:bors_database, BorsNG.Database.Repo)[:adapter]

  def up do
    case @adapter do
      Ecto.Adapters.Postgres ->
        execute "CREATE EXTENSION IF NOT EXISTS citext"
        alter table(:users) do
          modify :login, :citext
        end
      Ecto.Adapters.MySQL ->
        :ok
    end
  end

  def down do
    case @adapter do
      Ecto.Adapters.Postgres ->
        alter table(:users) do
          modify :login, :string
        end
        execute "DROP EXTENSION citext"
      Ecto.Adapters.MySQL ->
        :ok
    end
  end
end

Exclude MySQL from the `citext` migration
Exclude MySQL from the `citext` migration

MySQL has no such extension, and in fact, it's case-insensitive by default anyway.

bors-ng/bors-ng,bors-ng/bors-ng,bors-ng/bors-ng