Database architecture and transaction integrity
Overview
Section titled “Overview”PostgreSQL stores organization identities, users, sessions, CRM records, permissions, commercial documents and durable automation state. Seven core modules share a records table with typed common columns and module-specific JSON. Dedicated tables hold commercial snapshots, custom values, templates, scheduling, approval processes and revenue agreements. This is a relational application with selected JSON structures, not a document-only database.
Purpose
Section titled “Purpose”Use this reference to understand data ownership, migration boundaries and why supported application operations are necessary for consistent changes.
Prerequisites
Section titled “Prerequisites”-
Authorized database administration responsibility.
-
Release-specific migration and recovery evidence.
Procedure
Section titled “Procedure”-
Confirm the running migration using System Health runtime identity or the installation runbook. Compare it with the intended release before maintenance.
-
Identify the business object and its related records through the application. Common CRM links include account, contact, deal, parent and related record.
-
Treat document snapshots, history and scheduled work as part of the object lifecycle. Updating a single database value can leave those records inconsistent.
-
Before a release change, use a verified coordinated recovery point and rehearse the forward migration on isolated targets.
-
After authorized maintenance, compare migration state and health with the approved plan and perform representative read-only business checks.
Expected result
Section titled “Expected result”Database maintenance preserves the relationship graph, commercial history and durable work expected by the application.
Screenshots and diagrams
Section titled “Screenshots and diagrams”Important notes
Section titled “Important notes”-
Composite organization/reference constraints prevent cross-organization relationships for modeled links; service checks also validate module type and business consistency.
-
Money uses fixed-precision values with explicit currencies. Do not add different currencies without a documented conversion rule.
-
JSON fields and application validation are part of the schema contract. The presence of a database column does not make direct editing a supported workflow.
-
A database dump alone omits private file bytes and external recovery keys. Follow the coordinated recovery guide.
Troubleshooting
Section titled “Troubleshooting”-
A relationship update is rejected: check organization, module, visibility and account/contact consistency.
-
Migration and application versions differ: stop the change and reconcile the release plan before writing data.