[#878] Create 6 airdrop campaign DB tables#898
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Add migration 00035 with: pl_points (append-only ledger), pl_referrals, pl_referral_codes, pl_streaks, pl_daily_prices, pl_weekly_snapshots. Add corresponding TypeScript types to lib/supabase.ts. Fixes #878 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4c52776 to
d618b78
Compare
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: REQUEST CHANGES
Summary
The migration mostly matches the ticket scope, but the added lib/supabase.ts types do not currently match the nullability of the SQL schema. That misses one of the stated acceptance checks for this PR.
Findings
- [medium] Several
Rowfields are typed as non-null inlib/supabase.ts, but the migration does not declare those columnsNOT NULL, so Supabase can returnnullfor them.- File:
supabase/migrations/00035_airdrop_tables.sql:11 - Suggestion: either add
NOT NULLto the defaulted columns that are intended to always exist (created_at,is_farcaster_username,current_streak,longest_streak,new_stories,token_buys,new_referrals,total_pl_earned) or relax the generated TypeScript row types to allownull.
- File:
- [medium] The mismatch is visible in the new table typings themselves: for example
pl_points.Row.created_at,pl_referrals.Row.created_at,pl_referral_codes.Row.is_farcaster_username,pl_streaks.Row.current_streak, andpl_weekly_snapshots.Row.created_atare all declared non-null even though the SQL columns are nullable today.- File:
lib/supabase.ts:347 - Suggestion: bring the TS definitions into exact alignment with the migration before merging.
- File:
Decision
Requesting changes because the PR says the Supabase types match the schema, but they currently do not.
Align SQL schema with TypeScript types — columns with DEFAULT values should be NOT NULL since they always have values. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
The schema/type mismatch from my previous review is resolved. The migration now marks the defaulted columns as NOT NULL, which brings the SQL schema into line with the added lib/supabase.ts row types.
Findings
- No blocking findings in the updated patch.
Decision
Approving from a code-review standpoint. The migration matches the ticket scope, the indexes are present, and the TypeScript types now align with the schema.
Summary
00035_airdrop_tables.sqlwith 6 tables for the airdrop campaign:pl_points— append-only point ledger (buy, referral, write, rate actions)pl_referrals— referral relationshipspl_referral_codes— one code per wallet, supports Farcaster usernamespl_streaks— daily check-in streak trackingpl_daily_prices— PLOT price snapshots for TWAPpl_weekly_snapshots— weekly campaign statslib/supabase.tsFiles Changed
supabase/migrations/00035_airdrop_tables.sql— new migrationlib/supabase.ts— table types + convenience aliasespackage.json— patch bump 0.1.25 → 0.1.26Test plan
npm run typecheckpassesFixes #878
🤖 Generated with Claude Code