Skip to content

Database Schema

PHPCRM edited this page Dec 1, 2025 · 1 revision

๐Ÿ—„ Database Schema

PHPCRM uses a clean and optimized MySQL database design.
Each table serves a dedicated CRM function such as leads, customers, tasks, users and system operations.

Below is the complete database schema overview with table purpose.


๐Ÿ“‹ Table Overview

Table Name Purpose
users CRM users / admin login
customers Customer details and business information
leads Lead / enquiry records before conversion
tasks Follow-ups, reminders and assigned tasks
notes Notes and communication history
settings General application configuration

๐Ÿงฉ Table Descriptions

๐Ÿ”น users

Stores login credentials and user profile information.

Column Description
id Primary key
name Full name
email Login email
password Hashed password
role User role (admin/standard)
created_at Record created timestamp

๐Ÿ”น customers

Stores customer database information.

Column Description
id Primary key
name Customer name
phone Contact number
email Email
address Address / location
created_by Which user added the customer
created_at Timestamp

๐Ÿ”น leads

Tracks enquiries / sales opportunities before conversion to customers.

Column Description
id Primary key
name Person / company name
phone Contact number
email Email
status Lead stage (new / working / converted / closed)
source Lead origin (website / phone / campaign etc.)
assigned_to User handling the lead
created_at Timestamp

๐Ÿ”น tasks

Stores tasks / follow-ups / reminders.

Column Description
id Primary key
lead_id / customer_id Related record
task Task description
due_date Target date
status Pending / completed
assigned_to Staff member
created_at Timestamp

๐Ÿ”น notes

Stores communication history with leads / customers.

Column Description
id Primary key
lead_id / customer_id Associated record
note Note / update text
created_by User who logged note
created_at Timestamp

๐Ÿ”น settings

Stores CRM-wide basic configurations.


๐Ÿ”„ Relationships

  • One Lead can have multiple Tasks
  • One Lead can have multiple Notes
  • One Customer can have multiple Tasks
  • One Customer can have multiple Notes
  • Each record contains created_by or assigned_to referring to users table

๐Ÿง  Design Philosophy

  • Lightweight database
  • No unnecessary columns
  • Easy to extend with migration support
  • Developer-friendly modification

๐Ÿ“Œ Next Step

For guidelines on adding new fields or modules โ†’
๐Ÿ“ See Customization Guide (coming next)

If you want to understand modules โ†’
๐Ÿ“ See Modules Overview

Clone this wiki locally