defmodule Mv.Repo.Migrations.AddOidcToSettings do
  @moduledoc """
  Adds OIDC configuration columns to settings (ENV-overridable in UI).
  """

  use Ecto.Migration

  def up do
    alter table(:settings) do
      add :oidc_client_id, :string
      add :oidc_base_url, :string
      add :oidc_redirect_uri, :string
      add :oidc_client_secret, :string
      add :oidc_admin_group_name, :string
      add :oidc_groups_claim, :string
    end
  end

  def down do
    alter table(:settings) do
      remove :oidc_client_id
      remove :oidc_base_url
      remove :oidc_redirect_uri
      remove :oidc_client_secret
      remove :oidc_admin_group_name
      remove :oidc_groups_claim
    end
  end
end
