Skip to content

Commit d809c88

Browse files
committed
Merge origin/main (#218) into fix/t6-usage-pricing
2 parents 32e10d1 + 3aa123a commit d809c88

4 files changed

Lines changed: 14 additions & 22 deletions

supabase/proposed/20261023060200_drop_duplicate_indexes.sql renamed to supabase/migrations/20261023073000_drop_duplicate_indexes.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
-- DB-05 (proposed, destructive): drop indexes that duplicate another index
2-
-- on the same table and column.
1+
-- DB-05: drop indexes that duplicate another index on the same table and
2+
-- column. Approved by Adam 23 Oct 2026; moved from supabase/proposed/.
33
--
44
-- subscriptions idx_subscriptions_stripe_customer duplicates
55
-- idx_subscriptions_stripe_customer_id (both plain

supabase/proposed/20261023060300_promo_redeem_failures_primary_key.sql renamed to supabase/migrations/20261023073100_promo_redeem_failures_primary_key.sql

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
-- DB-05 (proposed): give private.promo_redeem_failures a primary key.
1+
-- DB-05: give private.promo_redeem_failures a primary key (approved by Adam
2+
-- 23 Oct 2026; moved from supabase/proposed/).
23
--
34
-- It is the one table without a primary key. Its natural columns
45
-- (user_id, failed_at) can repeat when two failures share a timestamp, so a
@@ -10,5 +11,7 @@
1011
-- IF NOT EXISTS skips the whole statement, primary key included; check with
1112
-- `\d private.promo_redeem_failures` first.
1213

13-
ALTER TABLE private.promo_redeem_failures
14-
ADD COLUMN IF NOT EXISTS id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY;
14+
-- The rewrite and lock are accepted: the table holds a handful of rows
15+
-- (1 on production on 23 Oct 2026) and only promo redemption writes to it.
16+
-- squawk-ignore adding-field-with-default,adding-serial-primary-key-field
17+
ALTER TABLE private.promo_redeem_failures ADD COLUMN IF NOT EXISTS id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY;

supabase/proposed/20261023060000_drop_legacy_policies.sql renamed to supabase/migrations/20261023080000_drop_legacy_policies.sql

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
-- DB-03 (proposed, destructive): drop policies that no migration created.
1+
-- DB-03: drop policies that no migration created. Approved by Adam on
2+
-- 23 Oct 2026; moved from supabase/proposed/. It was run by hand on staging
3+
-- and production first, after shared links, role reads and usage counts were
4+
-- tested on staging, so on both hosted projects this finds nothing to drop.
25
--
36
-- The QA run on 22 Oct 2026 found policies on production that are not in
47
-- staging or in supabase/migrations, including duplicate permissive ones on
@@ -24,7 +27,8 @@
2427
-- caller's own rows: without user_roles_select_own, signed-in users could no
2528
-- longer read their own role (SettingsPage and the curated_sources admin
2629
-- policies depend on it), and a drifted copy would keep the leak this fixes.
27-
-- Do a dry run first (BEGIN; ...; ROLLBACK;).
30+
-- Running it again changes nothing: every drop is IF EXISTS and the kept
31+
-- policies are never dropped.
2832

2933
DO $$
3034
DECLARE

‎supabase/proposed/20261023060100_drop_staging_auto_admin.sql‎

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)