Sales CRM & pipeline database schema

A sales CRM modelled end to end: accounts and contacts, leads converted into an account, contact and deal, deals moving through stages with full stage history, activities, quotes, forecasts, territories and custom fields.

CRM Pipeline ER diagram

Sales CRM & pipeline database schema n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 users idBIGINT emailVARCHAR full_nameVARCHAR roleVARCHAR manager_idBIGINT territory_idBIGINT quota_minorBIGINT is_activeBOOLEAN territories idBIGINT nameVARCHAR parent_idBIGINT assignment_rulesJSONB is_activeBOOLEAN accounts idBIGINT nameVARCHAR domainVARCHAR owner_user_idBIGINT territory_idBIGINT industryVARCHAR employee_countINTEGER annual_revenue_mi…BIGINT currency_codeCHAR parent_account_idBIGINT custom_fieldsJSONB created_atTIMESTAMP contacts idBIGINT account_idBIGINT first_nameVARCHAR last_nameVARCHAR emailVARCHAR phoneVARCHAR titleVARCHAR is_primaryBOOLEAN custom_fieldsJSONB created_atTIMESTAMP leads idBIGINT first_nameVARCHAR last_nameVARCHAR emailVARCHAR company_nameVARCHAR sourceVARCHAR statusVARCHAR scoreSMALLINT owner_user_idBIGINT disqualified_reas…VARCHAR converted_atTIMESTAMP converted_account…BIGINT converted_contact…BIGINT converted_deal_idBIGINT created_atTIMESTAMP pipeline_stages idBIGINT pipeline_keyVARCHAR nameVARCHAR positionSMALLINT probability_perce…SMALLINT is_wonBOOLEAN is_lostBOOLEAN entry_criteriaTEXT deals idBIGINT account_idBIGINT primary_contact_idBIGINT owner_user_idBIGINT stage_idBIGINT nameVARCHAR amount_minorBIGINT currency_codeCHAR probability_perce…SMALLINT expected_close_da…DATE statusVARCHAR lost_reasonVARCHAR sourceVARCHAR custom_fieldsJSONB created_atTIMESTAMP closed_atTIMESTAMP deal_stage_history idBIGINT deal_idBIGINT from_stage_idBIGINT to_stage_idBIGINT changed_by_user_idBIGINT amount_minor_at_c…BIGINT entered_atTIMESTAMP exited_atTIMESTAMP activities idBIGINT account_idBIGINT deal_idBIGINT contact_idBIGINT user_idBIGINT activity_typeVARCHAR subjectVARCHAR bodyTEXT directionVARCHAR occurred_atTIMESTAMP due_atTIMESTAMP completed_atTIMESTAMP duration_minutesINTEGER quotes idBIGINT deal_idBIGINT quote_numberVARCHAR versionSMALLINT statusVARCHAR currency_codeCHAR subtotal_minorBIGINT discount_minorBIGINT total_minorBIGINT valid_untilDATE sent_atTIMESTAMP accepted_atTIMESTAMP quote_line_items idBIGINT quote_idBIGINT product_codeVARCHAR descriptionVARCHAR quantityDECIMAL unit_price_minorBIGINT discount_percentDECIMAL amount_minorBIGINT term_monthsSMALLINT forecasts idBIGINT user_idBIGINT period_startDATE period_endDATE categoryVARCHAR amount_minorBIGINT currency_codeCHAR submitted_atTIMESTAMP custom_field_defini… idBIGINT entity_typeVARCHAR field_keyVARCHAR labelVARCHAR field_typeVARCHAR optionsJSONB is_requiredBOOLEAN positionSMALLINT

Related database schemas