-- apps/web/src/server/db/migrations/0096_referral_pct_below_fee.sql
-- C12: referral reward pct must stay strictly below platform fee (10%) so margin stays positive.

ALTER TABLE referral_settings DROP CONSTRAINT IF EXISTS referral_settings_referral_pct_check;

ALTER TABLE referral_settings ADD CONSTRAINT referral_pct_below_fee CHECK (referral_pct >= 1 AND referral_pct < 10);
