Skip to content

Affiliates Schema

Schema: ext_affiliates | Auto-generated on 2026-03-30


Affiliate registrations under a program owner.

ColumnTypeNullableDefault
iduuidNOgen_random_uuid()
user_iduuidNO—
program_owner_iduuidNO—
statustextNO'pending'
commission_ratenumericNO10
total_earningsnumericNO0
total_referralsintegerNO0
approved_attimestamptzYES—
created_attimestamptzNOnow()
updated_attimestamptzNOnow()

Affiliate discount/referral codes.

ColumnTypeNullableDefault
iduuidNOgen_random_uuid()
affiliate_iduuidNO—
codetextNO—
discount_percentnumericNO0
usage_countintegerNO0
is_activebooleanNOtrue
created_attimestamptzNOnow()

Tracked referral conversions with commission amounts.

ColumnTypeNullableDefault
iduuidNOgen_random_uuid()
code_iduuidNO—
affiliate_iduuidNO—
referred_user_iduuidNO—
order_reference_iduuidYES—
order_reference_typetextYES—
order_amountnumericYES—
commission_amountnumericYES—
statustextNO'pending'
confirmed_attimestamptzYES—
paid_attimestamptzYES—
created_attimestamptzNOnow()
updated_attimestamptzNOnow()

Affiliate payout withdrawal requests.

ColumnTypeNullableDefault
iduuidNOgen_random_uuid()
affiliate_iduuidNO—
amountnumericNO—
statustextNO'pending'
payment_iduuidYES—
notestextYES—
requested_attimestamptzNOnow()
processed_attimestamptzYES—
created_attimestamptzNOnow()
updated_attimestamptzNOnow()