From 36c5b53cddc81a1ae411bdc947f2a9717003bd9c Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Tue, 19 May 2026 18:44:30 +0530 Subject: [PATCH 1/2] fix: enable RLS for failed webhook events --- src/lib/db/rls-migrations.test.ts | 16 ++++++++++++++++ .../0011_failed_webhook_events_rls.sql | 1 + 2 files changed, 17 insertions(+) create mode 100644 src/lib/db/rls-migrations.test.ts create mode 100644 supabase/migrations/0011_failed_webhook_events_rls.sql diff --git a/src/lib/db/rls-migrations.test.ts b/src/lib/db/rls-migrations.test.ts new file mode 100644 index 0000000..55c00f3 --- /dev/null +++ b/src/lib/db/rls-migrations.test.ts @@ -0,0 +1,16 @@ +import { readFileSync } from 'node:fs'; +import { join } from 'node:path'; +import { describe, expect, it } from 'vitest'; + +describe('RLS migrations', () => { + it('enables RLS for failed_webhook_events', () => { + const migration = readFileSync( + join(process.cwd(), 'supabase/migrations/0011_failed_webhook_events_rls.sql'), + 'utf8', + ); + + expect(migration.toLowerCase()).toMatch( + /alter table(?: if exists)? failed_webhook_events enable row level security/, + ); + }); +}); diff --git a/supabase/migrations/0011_failed_webhook_events_rls.sql b/supabase/migrations/0011_failed_webhook_events_rls.sql new file mode 100644 index 0000000..f8f4bd0 --- /dev/null +++ b/supabase/migrations/0011_failed_webhook_events_rls.sql @@ -0,0 +1 @@ +ALTER TABLE IF EXISTS failed_webhook_events ENABLE ROW LEVEL SECURITY; From 51046d08b5101f27f97d73596bc3422807287fd8 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Thu, 21 May 2026 17:25:19 +0530 Subject: [PATCH 2/2] fix: renumber failed webhook rls migration --- src/lib/db/rls-migrations.test.ts | 4 ++-- ...hook_events_rls.sql => 0013_failed_webhook_events_rls.sql} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename supabase/migrations/{0011_failed_webhook_events_rls.sql => 0013_failed_webhook_events_rls.sql} (100%) diff --git a/src/lib/db/rls-migrations.test.ts b/src/lib/db/rls-migrations.test.ts index 55c00f3..1e1414b 100644 --- a/src/lib/db/rls-migrations.test.ts +++ b/src/lib/db/rls-migrations.test.ts @@ -3,9 +3,9 @@ import { join } from 'node:path'; import { describe, expect, it } from 'vitest'; describe('RLS migrations', () => { - it('enables RLS for failed_webhook_events', () => { + it('keeps the failed_webhook_events RLS migration statement intact', () => { const migration = readFileSync( - join(process.cwd(), 'supabase/migrations/0011_failed_webhook_events_rls.sql'), + join(process.cwd(), 'supabase/migrations/0013_failed_webhook_events_rls.sql'), 'utf8', ); diff --git a/supabase/migrations/0011_failed_webhook_events_rls.sql b/supabase/migrations/0013_failed_webhook_events_rls.sql similarity index 100% rename from supabase/migrations/0011_failed_webhook_events_rls.sql rename to supabase/migrations/0013_failed_webhook_events_rls.sql