Untitled

mail@pastecode.io avatar
unknown
plain_text
25 days ago
2.8 kB
2
Indexable
Never
Users Table
user_id : INT, PRIMARY KEY, AUTO_INCREMENT (User ID)
username : VARCHAR(255), UNIQUE (Username)
password : VARCHAR(255) (Password)
role : ENUM('Super Admin', 'Admin', 'Collaborator') (User Role)
email : VARCHAR(255), UNIQUE (Email)
phone : VARCHAR(20) (Contact Information)
created_at : TIMESTAMP DEFAULT CURRENT_TIMESTAMP (User Creation Date)
last_active : TIMESTAMP (Last Activity Date)
subscription_type : ENUM('Free', 'Basic', 'Advanced') (Plan Type)
status : ENUM('Active', 'Inactive', 'Expired') (Subscription Status)
Leads Table
lead_id : INT, PRIMARY KEY, AUTO_INCREMENT (Lead ID)
head_collaborator_id : INT, FOREIGN KEY (Users) (Head Collaborator)
status : ENUM('New', 'In Progress', 'Closed') (Lead Status)
pipeline_stage : VARCHAR(50) (Lead Pipeline Stage)
created_at : TIMESTAMP DEFAULT CURRENT_TIMESTAMP (Lead Creation Date)
comments : TEXT (Lead Comments)
Collaborators Table
collaborator_id : INT, PRIMARY KEY, AUTO_INCREMENT (Collaborator ID)
lead_id : INT, FOREIGN KEY (Leads) (Assigned Lead)
user_id : INT, FOREIGN KEY (Users) (Collaborator User ID)
assigned_at : TIMESTAMP DEFAULT CURRENT_TIMESTAMP (Assigned Date)
Activity Logs Table
log_id : INT, PRIMARY KEY, AUTO_INCREMENT (Log ID)
lead_id : INT, FOREIGN KEY (Leads) (Associated Lead ID)
user_id : INT, FOREIGN KEY (Users) (User who made the change)
action : VARCHAR(255) (Action Taken)
timestamp : TIMESTAMP DEFAULT CURRENT_TIMESTAMP (Date and Time of Action)
Reminders Table
reminder_id : INT, PRIMARY KEY, AUTO_INCREMENT (Reminder ID)
lead_id : INT, FOREIGN KEY (Leads) (Associated Lead ID)
reminder_date : DATETIME (Reminder Date and Time)
note : VARCHAR(255) (Reminder Note)
Plans Table
plan_id : INT, PRIMARY KEY, AUTO_INCREMENT (Plan ID)
plan_type : ENUM('Free', 'Basic', 'Advanced') (Plan Type)
features : TEXT (Description of features included)
Permissions Table
permission_id : INT, PRIMARY KEY, AUTO_INCREMENT (Permission ID)
role : ENUM('Super Admin', 'Admin', 'Collaborator') (Role)
can_add_leads : BOOLEAN (Can add leads)
can_edit_leads : BOOLEAN (Can edit leads)
can_delete_leads : BOOLEAN (Can delete leads)
can_view_reports : BOOLEAN (Can view reports)
can_manage_collaborators : BOOLEAN (Can manage collaborators)
Integration Table
integration_id : INT, PRIMARY KEY, AUTO_INCREMENT (Integration ID)
integration_type : VARCHAR(50) (Type of Integration, e.g., WhatsApp, Facebook)
user_id : INT, FOREIGN KEY (Users) (User ID for the integration)
Login/Logout Logs Table
log_entry_id : INT, PRIMARY KEY, AUTO_INCREMENT (Log Entry ID)
user_id : INT, FOREIGN KEY (Users) (User ID)
action : ENUM('Login', 'Logout') (Action Type)
timestamp : TIMESTAMP DEFAULT CURRENT_TIMESTAMP (Date and Time of Action)
Leave a Comment