defmodule Mv.Repo.Migrations.AddCustomFieldValuesValueGinIndex do
  @moduledoc """
  Adds a GIN index on `custom_field_values.value` (JSONB) to serve the boolean
  custom-field containment predicates used by the member overview.
  """

  use Ecto.Migration

  def up do
    create index(:custom_field_values, ["value"],
             name: "custom_field_values_value_gin_index",
             using: "gin"
           )
  end

  def down do
    drop_if_exists index(:custom_field_values, ["value"],
                     name: "custom_field_values_value_gin_index"
                   )
  end
end
