Subscription box database schema

How recurring physical commerce is modelled: plans and subscriptions, one row per billing cycle, preferences that drive curation, per-cycle box contents, shipments, skips and pauses, churn reasons and referral credit.

Subscription Box ER diagram

Subscription box database schema n1 n1 n1 n1 n1 n1 n1 n1 n1 11 n1 n1 n1 11 n1 n1 n1 members idBIGINT emailVARCHAR full_nameVARCHAR shipping_addressJSONB timezoneVARCHAR referral_codeVARCHAR statusVARCHAR created_atTIMESTAMPTZ plans idBIGINT codeVARCHAR nameVARCHAR interval_unitVARCHAR interval_countINTEGER price_minorINTEGER currency_codeCHAR items_per_boxINTEGER cutoff_days_beforeINTEGER activeBOOLEAN subscriptions idBIGINT member_idBIGINT plan_idBIGINT statusVARCHAR next_cycle_dateDATE paused_untilDATE payment_method_re…VARCHAR started_atTIMESTAMPTZ cancelled_atTIMESTAMPTZ billing_cycles idBIGINT subscription_idBIGINT cycle_numberINTEGER period_startDATE period_endDATE ship_dateDATE skip_deadlineDATE statusVARCHAR amount_minorINTEGER credit_applied_mi…INTEGER currency_codeCHAR charge_referenceVARCHAR billed_atTIMESTAMPTZ member_preferences subscription_idBIGINT attributeVARCHAR valueVARCHAR is_hard_constraintBOOLEAN updated_atTIMESTAMPTZ products idBIGINT skuVARCHAR nameVARCHAR brandVARCHAR attributesJSONB unit_cost_minorINTEGER on_handINTEGER available_fromDATE available_untilDATE cycle_items idBIGINT billing_cycle_idBIGINT product_idBIGINT skuVARCHAR nameVARCHAR quantityINTEGER unit_cost_minorINTEGER selection_reasonVARCHAR shipments idBIGINT billing_cycle_idBIGINT carrierVARCHAR tracking_numberVARCHAR address_snapshotJSONB statusVARCHAR shipped_atTIMESTAMPTZ delivered_atTIMESTAMPTZ subscription_events idBIGINT subscription_idBIGINT event_typeVARCHAR billing_cycle_idBIGINT effective_dateDATE detailJSONB created_byVARCHAR created_atTIMESTAMPTZ cancellation_reasons idBIGINT codeVARCHAR labelVARCHAR categoryVARCHAR is_recoverableBOOLEAN positionINTEGER cancellations subscription_idBIGINT reason_idBIGINT commentVARCHAR last_cycle_idBIGINT winback_offer_codeVARCHAR winback_acceptedBOOLEAN cancelled_atTIMESTAMPTZ referrals idBIGINT referrer_idBIGINT referred_member_idBIGINT code_usedVARCHAR statusVARCHAR qualified_atTIMESTAMPTZ created_atTIMESTAMPTZ credits idBIGINT member_idBIGINT sourceVARCHAR referral_idBIGINT applied_to_cycle_…BIGINT amount_minorINTEGER currency_codeCHAR expires_atDATE created_atTIMESTAMPTZ

Related database schemas