Skip to content
Closed
Show file tree
Hide file tree
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,4 @@
-- Add verification type 'send_token_hodler'
-- Pattern follows prior enum additions (see 20241009042110_alter_db_for_monthly_distributions.sql)
ALTER TYPE public.verification_type
ADD VALUE IF NOT EXISTS 'send_token_hodler' AFTER 'send_ceiling';
3 changes: 2 additions & 1 deletion supabase/schemas/distributions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ CREATE TYPE "public"."verification_type" AS ENUM (
'send_one_hundred',
'total_tag_referrals',
'send_streak',
'send_ceiling'
'send_ceiling',
'send_token_hodler'
);

ALTER TYPE "public"."verification_type" OWNER TO "postgres";
Expand Down
22 changes: 22 additions & 0 deletions supabase/tests/distribution_send_token_hodler_test.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
BEGIN;
SELECT plan(1);

-- For distributions with id >= 21, expect send_token_hodler to exist.
-- If no such distributions exist in the fixture, this test passes vacuously.
SELECT ok(
NOT EXISTS (
SELECT 1
FROM public.distributions d
WHERE d.id >= 21
AND NOT EXISTS (
SELECT 1
FROM public.distribution_verification_values dvv
WHERE dvv.distribution_id = d.id
AND dvv.type = 'send_token_hodler'::public.verification_type
)
),
'All distributions with id >= 21 have send_token_hodler verification value'
);

SELECT finish();
ROLLBACK;
Loading