Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-- Drop the local Songstats quota ledger (recoupable/chat#1797, bullet 2).
--
-- The ledger mirrored Songstats' rate quota locally so a budget gate could halt
-- the backfill drain before spending. In practice it drifted: the prod 429 storm
-- (2026-06) filled it with phantom 429 "hits" (insert-on-every-call, success or
-- not), so the gate tripped on rate-limit noise, not real quota — a premature
-- drain halt. Songstats is the rate authority; api now relies on per-track
-- bounded exponential backoff and defers rate-limited rows to the next run
-- instead of mirroring a quota.
--
-- Code references removed in api PR #674 (getBackfillBudgetStep,
-- insertSongstatsQuotaLedger, selectSongstatsQuotaSpent and their tests).
-- Created 20260610010000_create_playcount_measurement_store.sql.
-- CASCADE cleans up the table's indexes, RLS, and FKs.

DROP TABLE IF EXISTS public.songstats_quota_ledger CASCADE;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Using CASCADE on table drop can silently remove dependent objects outside this migration; drop without CASCADE to fail safely if unexpected dependencies exist.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At supabase/migrations/20260616000000_drop_songstats_quota_ledger.sql, line 16:

<comment>Using `CASCADE` on table drop can silently remove dependent objects outside this migration; drop without `CASCADE` to fail safely if unexpected dependencies exist.</comment>

<file context>
@@ -0,0 +1,16 @@
+-- Created 20260610010000_create_playcount_measurement_store.sql.
+-- CASCADE cleans up the table's indexes, RLS, and FKs.
+
+DROP TABLE IF EXISTS public.songstats_quota_ledger CASCADE;
</file context>
Suggested change
DROP TABLE IF EXISTS public.songstats_quota_ledger CASCADE;
DROP TABLE IF EXISTS public.songstats_quota_ledger;