SaintCRM docs
PHP / MariaDB edition contracts
Machine-readable contracts the future PHP edition should reuse: permissions, modules, Machine API shapes, and SQL type mappings.
Contract version 1.0.0
- JSON export: /docs/portability/contracts.json
- Live migration scan status: fail — New migrations (>=44) use Postgres-only SQL (050_social_posts_media.sql:jsonb×1, 052_workspace_settings.sql:jsonb×1, 055_custom_fields.sql:jsonb×1). Prefer varchar/text/timestamptz.
- Tenancy fields:
workspace_id+business_profile_id
PHP edition v1 modules
First cPanel subset (6 modules). Heavy collectors stay Node-only.
- Customers
customers2 tables · 5 permissions - Leads
leads5 tables · 3 permissions - Email CRM
email6 tables · 4 permissions - SEO Checker
seo-checker3 tables · 3 permissions - Google Ads Readiness
ads-readiness3 tables · 3 permissions - Reports
reports3 tables · 3 permissions
SQL type mappings
| Portable | Postgres | MariaDB | MySQL |
|---|---|---|---|
| varchar | varchar(n) | varchar(n) | varchar(n) |
| text | text | text / longtext | text / longtext |
| integer | integer | int | int |
| boolean | boolean | tinyint(1) | tinyint(1) |
| timestamptz | timestamptz | datetime(6) (store UTC) | datetime(6) (store UTC) |
| json_text | text (preferred) or jsonb (legacy) | longtext | longtext |
| decimal | numeric/decimal | decimal(p,s) | decimal(p,s) |
Rewrite vs reuse
contracts summary
{
"reuseCount": 51,
"machineOperations": 55,
"rewriteAdapters": [
"Next.js route handlers → PHP controllers or front controller",
"React admin UI → PHP templates or separate SPA",
"node:crypto vault → PHP OpenSSL AES-256-GCM compatible with v1: ciphertext format",
"tsx/node cron scripts → PHP CLI cron entrypoints",
"Postgres driver → PDO MariaDB/MySQL"
],
"deferredToNode": [
"Full IMAP sync and heavy email automation",
"Background workers that require long-lived Node processes",
"API-heavy keyword / ads collectors marked node-only"
]
}