A CRM data model you can copy
A CRM data model can be small. Most of the hard decisions come down to four records and how they relate: people, organizations, deals and pipelines.
This is the model Postware uses. It's open source under Apache 2.0, so you can copy it into your own database whether or not you ever use Postware.
The core records
Organization ──< Affiliation >── Person
│ │
│ │
└───────────< Deal >──────────┘
│
└──> Pipeline
A person can belong to several organizations through affiliations. A deal points at one organization, any number of people and one pipeline.
Person
| Field | Type | Notes |
|---|---|---|
name | Name | Required. Has given, family and full parts |
emails | ContactPoint[] | Any email identifies the person |
phones | ContactPoint[] | |
job_title | string | |
affiliations | Affiliation[] | Organizations, with role, primary flag and period |
Full definition: person.
Organization
| Field | Type | Notes |
|---|---|---|
name | string | Required |
urls | ContactPoint[] | Website first |
addresses | Address[] | Billing, shipping and so on |
parent | Ref to Organization | For subsidiaries |
identifiers | list | Use the domain, such as acme.com |
An organization has no type field for customer, vendor or partner. A company can be all three at once, so the relationship shows up in its deals, invoices and tags instead. Full definition: organization.
Deal
| Field | Type | Notes |
|---|---|---|
name | string | Required |
organization | Ref to Organization | |
people | list | Each has a person, a role and a primary flag |
pipeline | Ref to Pipeline | Required |
stage | string | Required. A stage key from the pipeline |
status | Status | open, won or lost |
amount | Money | |
probability | decimal | 0 to 1. Defaults from the stage |
expected_close | date | |
closed_at | datetime | Set when the deal leaves open |
Full definition: deal.
Pipeline
| Field | Type | Notes |
|---|---|---|
name | string | Required |
default | bool | Where new deals go if none is named |
stages | list | Each has a key, label, category, order and optional probability |
Every stage has a category of open, won or lost. Full definition: pipeline.
Six decisions worth copying
Don't make a Lead table. Salesforce-style Lead objects mean that when someone qualifies, you convert them, copy their data and leave a dead record behind. A lead is a person at an early stage. We store it as lifecycle_stage: lead on the person.
Separate stage from outcome. Sales teams rename stages constantly. If reports depend on stage names, they break each time. Mapping each stage to open, won or lost keeps "revenue won last quarter" stable.
Use a join for people and organizations. A single company_id on the contact seems fine until someone changes jobs, or advises two companies. An affiliation with a role and a time period keeps the history.
Store money as a decimal string and a currency. {"amount": "19.99", "currency": "USD"}. Floats round badly, and an amount with no currency stops being useful as soon as you sell in a second one.
Write down what makes a record a duplicate. A person is the same person if any email matches. An organization is matched on identifiers, usually its domain, because two companies can share a name. Matching on a company's name alone creates duplicates quickly. If a value is missing, it shouldn't match anything.
Keep outside IDs in one list. A person might have a HubSpot ID, a Stripe customer ID and a support tool ID. An identifiers list of {system, value} holds all of them without a new column for each integration, and it makes repeat imports safe.
Fields you'll want on top
Most teams end up needing these. Postware adds them as optional extensions, so the core model stays small:
| Extension | On | Purpose |
|---|---|---|
ext.crm.lifecycle_stage | Person, Organization | Subscriber through customer |
ext.crm.source | Person | The channel that produced the contact |
ext.crm.deal_source | Deal | The campaign or referral behind the deal |
ext.crm.lost_reason | Deal | Why it was lost |
ext.crm.won_reason | Deal | Why it was won |
ext.crm.line_items | Deal | Products on the deal before an invoice exists |
ext.crm.industry | Organization | Your own vocabulary |
ext.crm.employees | Organization | Headcount |
Use it in your own database
The definitions are YAML files in the standard/models folder on GitHub, and the compiled JSON Schema is in standard/dist. Take what's useful.
If you'd rather not build the database, duplicate rules and API yourself, Postware hosts these models, and it's free to start. It also includes the models that usually come next, such as invoice, subscription and ticket.
Try it with your own assistant
Paste this prompt into any AI assistant. It connects itself if it can, or walks you through it. Free to start. No card needed.