defmodule Mv.Repo.Migrations.AddUniqueEmailToMembers do
  @moduledoc """
  Updates resources based on their most recent snapshots.

  This file was autogenerated with `mix ash_postgres.generate_migrations`
  """

  use Ecto.Migration

  def up do
    # Ensure email uniqueness across all members
    # This supports upsert operations and prevents duplicate member accounts
    create unique_index(:members, [:email], name: "members_unique_email_index")
  end

  def down do
    drop_if_exists unique_index(:members, [:email], name: "members_unique_email_index")
  end
end
