Database
DerbyFish uses Supabase (PostgreSQL) with Row Level Security (RLS) on all tables.
Core Tables
profile
User profiles
captain
Bridge table marking profiles as captains
derby
Derby definitions
rankboard
Leaderboards for derbies
media
Uploaded photos and videos
bait_transaction
BAIT currency transactions
Upgrade Steps
The schema is organized into numbered upgrade steps. Each step adds a feature set:
01
BAIT currency
Live (partial)
02
Shops
Pending migration
03
Tickets & Pools
Pending migration
04
Prizes
Pending migration
05
Crew
Not started
06
Levels & Achievements
Not started
07
Data Points
Not started
08
Fish Cards
Not started
09
Outings
Live
10
Seasons
Pending migration
11
Sponsors
Live
12
Leagues & Clout
Not started
Key Design Decisions
Trophies, Achievements, Badges are three separate systems with no foreign keys between them
shoptable hascaptain_idFK tocaptaintable, notowner_profile_id. RLS goes throughcaptain.auth_idBAIT transactions use a
categoryenum with 12 valuescompute_points_ranking()in step-03 depends onsubmission_data_pointfrom step-07
RLS Pattern
Most tables use RLS policies that chain through the captain table:
This ensures captains can only see and modify their own data.
Last updated