defmodule Mv.Repo.Migrations.MemberRelation 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 1:1 relationship - one user can only be linked to one member
    # This prevents multiple users from sharing the same member account
    create unique_index(:users, [:member_id], name: "users_unique_member_index")
  end

  def down do
    drop_if_exists unique_index(:users, [:member_id], name: "users_unique_member_index")
  end
end
