Skip to content

Rolodex Data Model

This document describes the Rolodex core data concepts, their relationships, and provides an ER diagram to clarify the structure.

Core Data Concepts

Party

A generic entity representing either a person or an organisation.

  • party_id (Primary Key)
  • party_type ('person' or 'organisation')
  • display_name
  • created_at
  • updated_at

Person (subtype of Party)

Represents individuals.

  • party_id (FK to Party)
  • first_name
  • last_name
  • email
  • phone_primary
  • phone_secondary (optional)
  • date_of_birth (optional)

Organisation (subtype of Party)

Represents businesses or organisations.

  • party_id (FK to Party)
  • organisation_name
  • organisation_type
  • email
  • phone_primary
  • phone_secondary (optional)
  • registration_number (optional)

Address

Stores address details.

  • address_id (Primary Key)
  • address_line_1
  • address_line_2 (optional)
  • city
  • region (optional)
  • postal_code
  • country
  • address_type

PartyAddress (junction table)

Many-to-many relationship between Party and Address.

  • party_id (FK to Party)
  • address_id (FK to Address)

ExternalIdentifier

Stores identifiers from external external systems.

  • external_identifier_id (Primary Key)
  • party_id (FK to Party)
  • system_name
  • identifier
  • last_synced

PartyRelationship

Defines relationships between parties, including roles or descriptive labels.

  • relationship_id (Primary Key)
  • from_party_id (FK to Party)
  • to_party_id (FK to Party)
  • relationship_type
  • start_date (optional)
  • end_date (optional)
  • notes (optional)

Entity Relationship Diagram

erDiagram Party ||--o{ Person : "is subtype of" Party ||--o{ Organisation : "is subtype of" Party ||--o{ ExternalIdentifier : "has" Party ||--o{ PartyRelationship : "from party" Party ||--o{ PartyRelationship : "to party" Party ||--o{ PartyAddress : "associated with" Address ||--o{ PartyAddress : "associated with" Party { int party_id PK string party_type string display_name datetime created_at datetime updated_at } Person { int party_id FK string first_name string last_name string email string phone_primary string phone_secondary date date_of_birth } Organisation { int party_id FK string organisation_name string organisation_type string email string phone_primary string phone_secondary string registration_number } Address { int address_id PK string address_line_1 string address_line_2 string city string region string postal_code string country string address_type } PartyAddress { int party_id FK int address_id FK } ExternalIdentifier { int external_identifier_id PK int party_id FK string system_name string identifier datetime last_synced } PartyRelationship { int relationship_id PK int from_party_id FK int to_party_id FK string relationship_type date start_date date end_date string notes }

Data Relationships

  • Party has subtype relationships with Person and Organisation.
  • Party has one-to-many relationships with ExternalIdentifier and PartyRelationship.
  • Party has a many-to-many relationship with Address through the junction table PartyAddress.