feat(membership-fee): index fee cycles by member, status and end date

This commit is contained in:
Simon 2026-07-10 16:27:14 +02:00
parent cdb8b03ce1
commit 4b647c21e7
3 changed files with 238 additions and 0 deletions

View file

@ -0,0 +1,22 @@
defmodule Mv.Repo.Migrations.AddMembershipFeeCyclesStatusEndIndex do
@moduledoc """
Adds a composite index on membership_fee_cycles(member_id, status, cycle_end)
to serve the period-scoped unpaid-cycle count on the member overview.
This file was autogenerated with `mix ash_postgres.generate_migrations`.
"""
use Ecto.Migration
def up do
create index(:membership_fee_cycles, [:member_id, :status, :cycle_end],
name: "membership_fee_cycles_member_status_end_index"
)
end
def down do
drop_if_exists index(:membership_fee_cycles, [:member_id, :status, :cycle_end],
name: "membership_fee_cycles_member_status_end_index"
)
end
end