Appearance
Lead Management tables ​
Overview ​
The tables of the Lead Management (LM) module: dealers and dealerships, leads and their tasks, notes, products and emails, the product catalogue, CRM integrations (SharpSpring, Mautic), website visitor tracking and zip code data. 74 tables. Column lists are trimmed for tables with more than 12 columns: keys, flagged columns and a few important fields are in the table, the rest are named under it. The console command php artisan dam:setup (RemoveOtherData) drops 67 of these 74 tables with Schema::dropIfExists (all but verify_emails, forms, form_fields, lead_custom_field_data, guest_users, guest_visit_logs and contacts), so an environment where it has run will not have them even though the migrations create them. Which environments have run it cannot be told from the code.
Dealers and dealerships ​
Solid lines are foreign keys in the migrations; dotted lines are relations that exist only in the models. Tables from other pages appear without their own section here.
dealers ​
Dealers linked to a workspace and portal (address, login). Soft deleted.
Model: LM\Dealer · Created in 2021_01_08_155637_create_dealers_table.php · soft deletes
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
instance_id | bigint unsigned | no | FK → dam_instances.id | |
user_id | bigint unsigned | no | FK → users.id | |
name | varchar(255) | yes | ||
email | varchar(255) | no | ||
is_pointed_domain | tinyint | no | 0 | Comment: 1=Pointed, 0=Not Pointed |
is_active | tinyint | no | 1 | Comment: 0=Inactive, 1=Active |
deleted_at | timestamp | yes | soft delete |
Other columns: password, phone, address_line_1, address_line_2, city, state, zip_code, logo, is_archive, created_at, updated_at.
Indexes: dealers_email_unique unique (email).
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | workspaces.id | FK | cascade | - |
workspace_id | missing class LM\Workspace | Eloquent | - | Dealer::workspace() (issue: target model/table missing) |
instance_id | dam_instances.id | FK | cascade | - |
instance_id | missing class LM\DamInstance | Eloquent | - | Dealer::instance() (issue: target model/table missing) |
user_id | users.id | FK | cascade | - |
Referenced by: dealer_users.dealer_id.
dealerships ​
Dealerships (address, geo location). Soft deleted.
Model: LM\Dealership · Created in 2021_01_28_111918_create_dealerships_table.php · changed by 2 later migrations: 2022_01_24_162325, 2022_02_03_163703 · soft deletes
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
dealership_name | varchar(255) | yes | ||
email | varchar(255) | no | ||
is_multi_location | tinyint | no | 0 | Comment: 1=Multi location, 0=Single location |
deleted_at | timestamp | yes | soft delete | |
lat | varchar(255) | yes | Comment: latitude of dealership | |
lon | varchar(255) | yes | Comment: longitude of dealership |
Other columns: dealership_number, phone, office_phone, address_line_1, address_line_2, city, state, country, zip_code, logo, county, email_verified_at, created_at, updated_at, open_street_map_address.
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | workspaces.id | FK | cascade | - |
Referenced by: dealer_ship_communication_preferences.dealership_id, dealership_favourite_users.dealership_id, dealership_notes.dealership_id, dealership_products.dealership_id, dealership_rsm_assigns.dealership_id, dealership_users.dealership_id, dealership_users_invitations.dealership_id, group_network_dealerships.dealership_id, lead_assign_dealerships.dealership_id, lead_products.dealership_id, lead_rsm_assigns.dealership_id, lm_system_notifications.dealership_id, verify_emails.user_id.
dealership_users ​
Users of a dealership (role, communication flags).
Model: LM\DealershipUser · Created in 2021_01_28_112223_create_dealership_users_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
dealership_id | bigint unsigned | no | FK → dealerships.id | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
user_id | bigint unsigned | yes | FK → users.id | |
name | varchar(255) | no | ||
email | varchar(255) | no | ||
role | varchar(255) | no | ||
is_lead_assign | tinyint | no | 0 | Comment: 1 = True, 0 = False |
is_primary_contact | tinyint | no | 0 | Comment: 1 = Show Contact, 0 = not Show |
is_communication_text | tinyint | no | 0 | Comment: 1 = True, 0 = False |
is_communication_email | tinyint | no | 0 | Comment: 1 = True, 0 = False |
is_communication_phone | tinyint | no | 0 | Comment: 1 = True, 0 = False |
is_lead_visible | tinyint | no | 1 | Comment: 1 = True, 0 = False |
is_active | tinyint | no | 0 | Comment: 0=Inactive, 1=Active |
Other columns: designation, phone, created_at, updated_at.
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
dealership_id | dealerships.id | FK | cascade | DealershipUser::dealershipDetails(), Dealership::dealershipPrimaryContact(), Dealership::dealershipAllUsers() |
workspace_id | workspaces.id | FK | cascade | - |
user_id | users.id | FK | cascade | DealershipUser::user() |
role | roles.id | Eloquent | - | DealershipUser::rolesDetails() |
designation_id | dealership_designations.id | Eloquent | - | DealershipUser::designationDetails() (issue: column dealership_users.designation_id not in migrations) |
Referenced by: dealership_favourite_users.dealership_users_id, dealership_user_tasks.dealership_user_id.
dealership_designations ​
Designation list for dealership users.
Model: LM\DealershipDesignation · Created in 2021_02_19_163420_create_dealership_designations_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
name | varchar(255) | no | ||
created_by | bigint unsigned | yes | FK → users.id | |
updated_by | bigint unsigned | yes | FK → users.id | |
status | enum(0,1) | no | 1 | Comment: 0= In Active, 1= Active |
sort_order | int | yes | ||
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | workspaces.id | FK | cascade | - |
created_by | users.id | FK | cascade | DealershipDesignation::createdByDetails() |
updated_by | users.id | FK | cascade | - |
dealership_favourite_users ​
Favourite users of a dealership.
Model: LM\DealershipFavouriteUser · Created in 2021_01_28_112537_create_dealership_favourite_users_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
dealership_id | bigint unsigned | no | FK → dealerships.id | |
dealership_users_id | bigint unsigned | no | FK → dealership_users.id | |
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
dealership_id | dealerships.id | FK | cascade | - |
dealership_users_id | dealership_users.id | FK | cascade | - |
dealership_products ​
Products and categories a dealership handles.
Model: LM\DealershipProduct · Created in 2021_01_28_112927_create_dealership_products_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
dealership_id | bigint unsigned | no | FK → dealerships.id | |
category_id | bigint unsigned | no | FK → categories.id | |
product_id | bigint unsigned | no | FK → products.id | |
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
dealership_id | dealerships.id | FK | cascade | Dealership::dealership_products(), Dealership::dealershipProducts() |
category_id | categories.id | FK | cascade | - |
product_id | products.id | FK | cascade | DealershipProduct::product() |
Referenced by: product_images.product_id (not a key match).
dealership_notes ​
Notes on a dealership.
Model: LM\DealershipNote · Created in 2021_01_28_113053_create_dealership_notes_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
dealership_id | bigint unsigned | no | FK → dealerships.id | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
user_id | bigint unsigned | no | FK → users.id | |
note | longtext | yes | ||
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
dealership_id | dealerships.id | FK | cascade | - |
workspace_id | workspaces.id | FK | cascade | - |
user_id | users.id | FK | cascade | DealershipNote::userDetails() |
dealership_rsm_assigns ​
Regional sales manager (RSM) assignment to a dealership, category and product.
Model: LM\DealershipRsmAssign · Created in 2021_02_17_173405_create_dealership_rsm_assigns_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
dealership_id | bigint unsigned | no | FK → dealerships.id | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
rsm_user_id | bigint unsigned | no | Comment: This is the id of Users table; FK → users.id | |
category_id | bigint unsigned | no | FK → categories.id | |
product_id | bigint unsigned | yes | ||
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
dealership_id | dealerships.id | FK | cascade | Dealership::dealershipRsmAssign(), Dealership::dealershipRsmUser() |
workspace_id | workspaces.id | FK | cascade | - |
rsm_user_id | users.id | FK | cascade | DealershipRsmAssign::user() |
category_id | categories.id | FK | cascade | DealershipRsmAssign::category() |
product_id | not declared | Column only | - | - |
dealership_users_invitations ​
Invitations of dealership users.
Model: LM\DealershipUsersInvitations · Created in 2021_02_17_103106_create_dealership_users_invitations_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
dealership_id | bigint unsigned | no | FK → dealerships.id | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
user_id | bigint unsigned | no | FK → users.id | |
role_id | bigint unsigned | no | FK → roles.id | |
module_id | bigint unsigned | yes | FK → modules.id | |
email | varchar(255) | no | ||
name | varchar(255) | yes | ||
token | varchar(255) | no | ||
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
dealership_id | dealerships.id | FK | cascade | - |
workspace_id | workspaces.id | FK | cascade | - |
user_id | users.id | FK | cascade | DealershipUsersInvitations::user() |
role_id | roles.id | FK | cascade | - |
module_id | modules.id | FK | cascade | - |
dealership_user_tasks ​
Pivot: lead tasks assigned to dealership users.
Model: LM\DealershipUserTask · Created in 2021_01_29_183740_create_dealership_user_tasks_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
lead_task_id | bigint unsigned | no | FK → lead_tasks.id | |
dealership_user_id | bigint unsigned | no | FK → dealership_users.id | |
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
lead_task_id | lead_tasks.id | FK | cascade | - |
dealership_user_id | dealership_users.id | FK | cascade | - |
group_networks ​
Dealership group networks.
Model: LM\GroupNetwork · Created in 2021_04_16_122343_create_group_networks_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
created_by | bigint unsigned | no | FK → users.id | |
group_name | varchar(255) | no | ||
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | workspaces.id | FK | cascade | - |
created_by | users.id | FK | cascade | - |
Referenced by: group_network_dealership_users.group_id, group_network_dealerships.group_id.
group_network_dealerships ​
Dealerships in a group network.
Model: LM\GroupNetworkDealership · Created in 2021_04_16_122349_create_group_network_dealerships_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
group_id | bigint unsigned | no | FK → group_networks.id | |
dealership_id | bigint unsigned | no | FK → dealerships.id | |
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | workspaces.id | FK | cascade | - |
group_id | group_networks.id | FK | cascade | - |
dealership_id | dealerships.id | FK | cascade | - |
group_network_dealership_users ​
Users in a group network.
Model: LM\GroupNetworkDealershipUsers · Created in 2021_04_16_122353_create_group_network_dealership_users_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
group_id | bigint unsigned | no | FK → group_networks.id | |
user_id | bigint unsigned | no | ||
role_type | tinyint | no | 1 | Comment: 1= delaer admin, 2 sales preson |
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | workspaces.id | FK | cascade | - |
group_id | group_networks.id | FK | cascade | - |
user_id | users.id | Eloquent | - | GroupNetworkDealershipUsers::user() |
communication_preferences ​
Communication preference options.
Model: LM\CommunicationPreferences · Created in 2021_02_24_200321_create_communication_preferences_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
name | varchar(255) | no | ||
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
dealer_ship_communication_preferences ​
Communication preferences of a dealership.
Model: LM\DealerShipCommunicationPreferences · Created in 2021_02_26_093830_create_dealer_ship_communication_preferences_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
dealership_id | bigint unsigned | no | FK → dealerships.id | |
communication_preferences_id | bigint unsigned | no | ||
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
dealership_id | dealerships.id | FK | cascade | - |
communication_preferences_id | not declared (name suggests communication_preferences) | Column only | - | - |
rsm_notes ​
Notes on an RSM user.
Model: LM\RsmNotes · Created in 2022_01_21_173918_create_rsm_notes_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
rsm_user_id | bigint unsigned | no | FK → users.id | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
user_id | bigint unsigned | no | FK → users.id | |
note | longtext | yes | ||
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
rsm_user_id | users.id | FK | cascade | - |
workspace_id | workspaces.id | FK | cascade | - |
user_id | users.id | FK | cascade | RsmNotes::userDetails() |
Leads ​
Solid lines are foreign keys in the migrations; dotted lines are relations that exist only in the models. Tables from other pages appear without their own section here.
leads ​
Leads (contact data, source, score, status, SharpSpring / Mautic ids, visitor data).
Model: LM\Lead · Created in 2021_01_27_175104_create_leads_table.php · changed by 10 later migrations (latest update/2023_12_08_165550_add_user_infomation_columns_in_leads_table.php)
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment; auto increment starts at 1000 | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
user_id | bigint unsigned | yes | FK → users.id | |
email | varchar(255) | no | ||
lead_status | varchar(255) | yes | ||
is_assign | tinyint | no | 0 | Comment: 0=Not Assign, 1=Assign |
status | enum(1,2) | no | 1 | Comment: 1 -Manual, 2 - CronJob |
is_current_owner | enum(1,0) | no | 0 | Comment: 1 -Yes, 0 - No |
is_manual | enum(1,2) | no | 1 | Comment: 1 -Manual, 2 - CronJob |
is_qualify | enum(1,0) | no | 0 | Comment: 1 - Yes, 2 - No |
is_communication_text | tinyint | no | 0 | Comment: 0=False, 1=True |
is_communication_email | tinyint | no | 0 | Comment: 0=False, 1=True |
is_communication_phone | tinyint | no | 0 | Comment: 0=False, 1=True |
form_id | varchar(255) | yes | ||
sharp_spring_lead_id | varchar(255) | yes | ||
lat | varchar(255) | yes | Comment: latitude of lead | |
lon | varchar(255) | yes | Comment: longitude of lead | |
is_synced_from_sharpspring | tinyint | no | 0 | Comment: indicate that this leads is synced through sharpspring apis |
mautic_lead_id | varchar(255) | no | declared with ->null(), which has no effect, so the column is NOT NULL | |
mautic_request | varchar(255) | no | declared with ->null(), which has no effect, so the column is NOT NULL | |
mautic_events | varchar(255) | no | declared with ->null(), which has no effect, so the column is NOT NULL | |
custom_form_id | bigint unsigned | yes | NULL | FK → forms.id |
status_id | tinyint | yes | 1 | |
type | tinyint(1) | yes | 0 | Comment: 0 => Unique,1 => Repeat |
Other columns: first_name, last_name, phone, address_line_1, address_line_2, city, state, country, zip_code, lead_source, lead_score_text, lead_score, lead_note, communication_preferance, qualify_note, logo, form_title, response, last_activity_date, timeline, county, lead_score_updated_at, created_at, updated_at, open_street_map_address, assignment_date, uuid, status_value, ip, user_agent, browser_name, browser_v_name, os_family, os_name, os_version, device_type, device_family, device_model, page_title, page_url.
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | workspaces.id | FK | cascade | - |
user_id | users.id | FK | cascade | - |
lead_status | lead_status.id | Eloquent | - | LeadStatus::formLeads() |
custom_form_id | forms.id | FK | set null | Lead::form() |
status_id | not declared | Column only | - | - |
Referenced by: lead_activity_permissions.lead_id, lead_assign_dealerships.lead_id, lead_custom_field_data.lead_id, lead_emails.lead_id, lead_favourites.lead_id, lead_life_lines.lead_id, lead_products.lead_id, lead_reads.lead_id, lead_receive_emails.lead_id, lead_rsm_assigns.lead_id, lead_send_emails.lead_id, lead_tasks.lead_id, lm_system_notifications.lead_id.
lead_status ​
Lead statuses per workspace (name, colour, order, lock).
Model: LM\LeadStatus · Created in 2021_08_26_175923_lead_status.php · changed by 2 later migrations: 2022_02_14_133019, 2022_04_12_175119
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
workspace_id | bigint unsigned | yes | FK → workspaces.id | |
status_name | varchar(255) | no | ||
status_color | varchar(255) | no | ||
sort_order | int | yes | ||
is_active | tinyint | no | 1 | Comment: 1=Active, 0=Deactive |
created_at | timestamp | yes | ||
updated_at | timestamp | yes | ||
description | varchar(255) | yes | ||
is_lock | enum(0,1) | no | 0 | Comment: 0 = No, 1 = Yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | workspaces.id | FK | cascade | - |
Referenced by: lead_products.lead_status, leads.lead_status.
lead_statuses ​
Old lead status list (name, colour). No model uses it; lead_status replaced it.
Model: none · Created in 2021_01_26_120550_create_lead_statuses_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
status_name | varchar(255) | no | ||
status_color | varchar(255) | no | ||
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
lead_assign_dealerships ​
Assignment of a lead (and product) to a dealership.
Model: LM\LeadAssignDealership · Created in 2021_01_28_113235_create_lead_assign_dealerships_table.php · changed by 1 later migration: 2022_04_29_132525
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
lead_id | bigint unsigned | no | FK → leads.id | |
workspace_id | bigint unsigned | yes | FK → workspaces.id | |
dealership_id | bigint unsigned | no | FK → dealerships.id | |
product_id | bigint unsigned | yes | FK → products.id | |
created_at | timestamp | yes | ||
updated_at | timestamp | yes | ||
assignment_id | int | no | declared with ->null(), which has no effect, so the column is NOT NULL |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
lead_id | leads.id | FK | cascade | LeadAssignDealership::leadDetails(), Lead::dealers() |
workspace_id | workspaces.id | FK | cascade | - |
dealership_id | dealerships.id | FK | cascade | - |
product_id | products.id | FK | cascade | - |
assignment_id | not declared | Column only | - | - |
lead_rsm_assigns ​
RSM assignment of a lead.
Model: LM\LeadRsmAssign · Created in 2021_02_19_164335_create_lead_rsm_assigns_table.php · changed by 1 later migration: 2022_04_29_132554
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
lead_id | bigint unsigned | no | FK → leads.id | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
dealership_id | bigint unsigned | yes | FK → dealerships.id | |
product_id | bigint unsigned | yes | FK → products.id | |
rsm_user_id | bigint unsigned | no | Comment: This is the id of Users table; FK → users.id | |
created_at | timestamp | yes | ||
updated_at | timestamp | yes | ||
assignment_id | int | no | declared with ->null(), which has no effect, so the column is NOT NULL |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
lead_id | leads.id | FK | cascade | Lead::rsm(), Lead::rsmData() |
workspace_id | workspaces.id | FK | cascade | - |
dealership_id | dealerships.id | FK | cascade | - |
product_id | products.id | FK | cascade | - |
rsm_user_id | users.id | FK | cascade | LeadRsmAssign::users() (swapped keys) |
assignment_id | not declared | Column only | - | - |
Referenced by: lead_products.dealership_id (not a key match).
lead_products ​
Products a lead is interested in, with status and variant.
Model: LM\LeadProduct · Created in 2021_01_28_175842_create_lead_products_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
category_id | bigint unsigned | yes | FK → categories.id | |
product_id | bigint unsigned | yes | FK → products.id | |
dealership_id | bigint unsigned | yes | ||
lead_status | varchar(255) | yes | ||
variant_id | bigint unsigned | yes | ||
variant_option_id | bigint unsigned | yes | ||
lead_id | bigint unsigned | yes |
Other columns: lead_source, product_name, variant_options, sort_order, created_at, updated_at.
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | workspaces.id | FK | cascade | - |
category_id | categories.id | FK | cascade | LeadProduct::categoryDetailes() |
product_id | products.id | FK | cascade | - |
dealership_id | dealerships.id | Eloquent | - | LeadProduct::dealershipDetails() |
dealership_id | lead_rsm_assigns.dealership_id | Eloquent | - | LeadProduct::rsmDetails() (matches on lead_rsm_assigns.dealership_id, which is not a key) |
lead_status | lead_status.id | Eloquent | - | LeadStatus::product(), LeadProduct::statusDetails() |
variant_id | product_variants.id | Eloquent | - | LeadProduct::variantDetailes() |
variant_option_id | product_variant_options.id | Eloquent | - | LeadProduct::variantOptionsDetailes() |
lead_id | leads.id | Eloquent | - | Lead::products(), Lead::productsDetails(), Lead::modelsDetails() |
Referenced by: product_variants.product_id (not a key match).
lead_tasks ​
Tasks on a lead.
Model: LM\LeadTask · Created in 2021_01_28_161010_create_lead_tasks_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
lead_id | bigint unsigned | yes | FK → leads.id | |
workspace_id | bigint unsigned | yes | ||
product_id | bigint unsigned | yes | FK → products.id | |
user_id | bigint unsigned | yes | FK → users.id | |
title | varchar(255) | no | ||
status_text | varchar(255) | yes |
Other columns: due_date, description, display_file_name, file_name, file_type, created_at, updated_at.
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
lead_id | leads.id | FK | cascade | - |
workspace_id | not declared (name suggests workspaces) | Column only | - | - |
product_id | products.id | FK | cascade | LeadTask::productDetails() |
user_id | users.id | FK | cascade | LeadTask::userDetails() |
status_text | lead_task_statuses.id | Eloquent | - | LeadTask::taskstatus(), LeadTaskStatus::leadTask() |
Referenced by: dealership_user_tasks.lead_task_id, lm_system_notifications.task_id.
lead_task_statuses ​
Lead task statuses per workspace.
Model: LM\LeadTaskStatus · Created in 2021_03_03_172804_create_lead_task_statuses_table.php · changed by 1 later migration: 2022_04_13_134004
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
workspace_id | bigint unsigned | yes | ||
status_name | varchar(255) | no | ||
status_color | varchar(255) | no | ||
sort_order | int | yes | ||
is_active | tinyint | no | 1 | Comment: 1=Active, 0=Deactive |
created_at | timestamp | yes | ||
updated_at | timestamp | yes | ||
is_lock | enum(0,1) | no | 0 | Comment: 0 = No, 1 = Yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | not declared (name suggests workspaces) | Column only | - | - |
Referenced by: lead_tasks.status_text.
lead_life_lines ​
Lead timeline events.
Model: LM\LeadLifeLine · Created in 2021_01_28_121717_create_lead_life_lines_table.php · changed by 3 later migrations: 2022_03_03_161225, 2022_03_14_171717, 2022_05_23_161611
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
lead_id | bigint unsigned | no | FK → leads.id | |
workspace_id | bigint unsigned | yes | ||
product_id | bigint unsigned | yes | ||
title | longtext | no | redefined with ->change() in 2022_03_14_171717… | |
sharp_spring_event_id | bigint unsigned | yes | ||
sharp_spring_what_id | bigint unsigned | yes | ||
task_id | bigint unsigned | yes | ||
user_id | int | yes | ||
mautic_event_id | varchar(255) | no | declared with ->null(), which has no effect, so the column is NOT NULL |
Other columns: type, description, lead_date, display_file_name, file_name, file_type, created_at, updated_at.
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
lead_id | leads.id | FK | cascade | - |
workspace_id | not declared (name suggests workspaces) | Column only | - | - |
product_id | not declared | Column only | - | - |
task_id | not declared | Column only | - | - |
user_id | not declared | Column only | - | - |
lead_notes ​
Notes on a lead.
Model: LM\LeadNote · Created in 2021_01_28_161739_create_lead_notes_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
lead_id | bigint unsigned | yes | ||
workspace_id | bigint unsigned | yes | ||
user_id | bigint unsigned | yes | ||
note | longtext | yes | ||
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
lead_id | not declared (name suggests leads) | Column only | - | - |
workspace_id | not declared (name suggests workspaces) | Column only | - | - |
user_id | users.id | Eloquent | - | LeadNote::userDetails() |
lead_favourites ​
Per-user favourite flag on a lead.
Model: LM\LeadFavourite · Created in 2021_02_23_102327_lead_favourite.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
lead_id | bigint unsigned | no | FK → leads.id | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
user_id | bigint unsigned | no | Comment: This is the id of Users table; FK → users.id | |
is_favourite | int | no | ||
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
lead_id | leads.id | FK | cascade | - |
workspace_id | workspaces.id | FK | cascade | - |
user_id | users.id | FK | cascade | - |
lead_reads ​
Per-user read flag on a lead.
Model: LM\LeadRead · Created in 2021_02_23_103314_lead_read.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
lead_id | bigint unsigned | no | FK → leads.id | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
user_id | bigint unsigned | no | Comment: This is the id of Users table; FK → users.id | |
is_read | int | no | ||
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
lead_id | leads.id | FK | cascade | Lead::leadReads() (swapped keys) |
workspace_id | workspaces.id | FK | cascade | - |
user_id | users.id | FK | cascade | - |
lead_activity_permissions ​
Per-user activity notification flag on a lead.
Model: LM\LeadActivityPermission · Created in 2021_09_17_175524_lead_activity_permission.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
lead_id | bigint unsigned | no | FK → leads.id | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
user_id | bigint unsigned | no | Comment: This is the id of Users table; FK → users.id | |
is_sent | int | no | ||
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
lead_id | leads.id | FK | cascade | - |
workspace_id | workspaces.id | FK | cascade | - |
user_id | users.id | FK | cascade | - |
lead_task_filter_histories ​
Saved lead task filters.
Model: LM\LeadTaskFilterHistory · Created in 2021_09_13_161539_lead_task_filter_history.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
workspace_id | bigint unsigned | yes | ||
name | varchar(255) | yes | ||
save_data | longtext | yes | ||
created_by | bigint unsigned | yes | FK → users.id | |
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | not declared (name suggests workspaces) | Column only | - | - |
created_by | users.id | FK | cascade | - |
lead_score_update_logs ​
Log of lead score API calls (request, response, status).
Model: LM\LeadScoreUpdateLog · Created in 2021_06_09_155417_create_lead_score_update_track_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
api_request | varchar(255) | no | ||
api_response | varchar(255) | no | ||
api_status | int | no | ||
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
lead_custom_field_sets ​
Lead custom field set names.
Model: LM\LeadCustomFieldSet · Created in 2021_12_08_191901_create_lead_custom_field_sets_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
field_name | varchar(255) | no | ||
is_active | tinyint | no | 1 | Comment: 1=Active, 0=Deactive |
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
lead_custom_field_data ​
Custom field values and raw form payload of a lead.
Model: LM\LeadCustomFieldData · Created in update/2023_11_20_133622_create_lead_custom_field_data_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
lead_id | bigint unsigned | no | FK → leads.id | |
custom_fields | json | yes | NULL | |
form_payload | json | yes | NULL | |
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
lead_id | leads.id | FK | cascade | LeadCustomFieldData::lead(), Lead::leadCustomFieldData() |
lm_system_notifications ​
In-app LM notifications.
Model: LM\LMSystemNotification · Created in 2021_12_15_152540_l_m_system_notification.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
user_id | bigint unsigned | no | FK → users.id | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
sender_user_id | bigint unsigned | no | FK → users.id | |
lead_id | int | yes | ||
dealership_id | int | yes | ||
task_id | int | yes | ||
notification_text | longtext | yes | ||
read_at | datetime | yes | ||
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
user_id | users.id | FK | cascade | - |
workspace_id | workspaces.id | FK | cascade | LMSystemNotification::workspaceDetail() (swapped keys) |
sender_user_id | users.id | FK | cascade | LMSystemNotification::senderUserDetail() |
lead_id | leads.id | Eloquent | - | LMSystemNotification::leadDetail() |
dealership_id | dealerships.id | Eloquent | - | LMSystemNotification::dealershipDetail() |
task_id | lead_tasks.id | Eloquent | - | LMSystemNotification::taskDetail() |
hold_resume_lm_invitations ​
Queued LM invitation emails held while notifications are paused.
Model: LM\HoldResumeLmInvitation · Created in 2021_09_29_122749_create_hold_resume_lm_invitations_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
workspace_id | bigint unsigned | yes | ||
send_by | bigint unsigned | yes | ||
is_send | tinyint | no | 0 | Comment: 0=pending, 1=sent |
to | varchar(255) | no | ||
email_class | varchar(255) | no | ||
email_data | longtext | no | ||
send_at | datetime | yes | ||
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | not declared (name suggests workspaces) | Column only | - | - |
send_by | not declared | Column only | - | - |
Lead email ​
Solid lines are foreign keys in the migrations; dotted lines are relations that exist only in the models. Tables from other pages appear without their own section here.
lead_send_emails ​
Emails sent to a lead (old table).
Model: LM\LeadSendEmail · Created in 2021_01_28_162806_create_lead_send_emails_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
lead_id | bigint unsigned | no | FK → leads.id | |
template_id | bigint unsigned | no |
Other columns: from, to, cc, subject, description, display_file_name, file_name, file_type, created_at, updated_at.
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
lead_id | leads.id | FK | cascade | - |
template_id | not declared (name suggests lead_email_templates) | Column only | - | - |
lead_emails ​
Emails sent to a lead.
Model: LM\LeadEmail · Created in 2021_12_16_133631_create_lead_emails_table.php · changed by 1 later migration: 2022_04_07_164340
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
template_id | bigint unsigned | yes | ||
lead_id | bigint unsigned | no | FK → leads.id | |
subject | varchar(255) | no | ||
body | longtext | no | ||
status | varchar(255) | no | sent | Comment: sent, draft |
created_at | timestamp | yes | ||
updated_at | timestamp | yes | ||
signature | longtext | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | workspaces.id | FK | cascade | - |
template_id | not declared (name suggests lead_email_templates) | Column only | - | - |
lead_id | leads.id | FK | cascade | - |
Referenced by: lead_email_attachments.email_id.
lead_email_attachments ​
Attachments of a sent lead email.
Model: LM\LeadEmailAttachment · Created in 2021_12_16_154627_create_lead_email_attachments_table.php · changed by 1 later migration: 2022_01_13_125935
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
email_id | bigint unsigned | no | FK → lead_emails.id | |
attachment | varchar(255) | no | ||
org_file_name | varchar(255) | no | Comment: Original file name | |
created_at | timestamp | yes | ||
updated_at | timestamp | yes | ||
url | varchar(255) | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
email_id | lead_emails.id | FK | cascade | LeadEmail::attachments() |
lead_receive_emails ​
Emails received from a lead (IMAP).
Model: LM\LeadReceiveEmail · Created in 2022_01_10_192848_create_lead_receive_emails_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
lead_id | bigint unsigned | no | FK → leads.id | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
message_id | varchar(255) | no | ||
subject | varchar(255) | no | ||
from | varchar(255) | no | ||
body | longtext | no | ||
attachments_count | tinyint | no | ||
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
lead_id | leads.id | FK | cascade | - |
workspace_id | workspaces.id | FK | cascade | - |
Referenced by: lead_receive_email_attachments.email_id.
lead_receive_email_attachments ​
Attachments of a received lead email.
Model: LM\LeadReceiveEmailAttachment · Created in 2022_01_11_172618_create_lead_receive_email_attachments_table.php · changed by 1 later migration: 2022_01_13_122120
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
email_id | bigint unsigned | no | FK → lead_receive_emails.id | |
attachment | varchar(255) | no | ||
org_file_name | varchar(255) | no | Comment: Original file name | |
created_at | timestamp | yes | ||
updated_at | timestamp | yes | ||
url | varchar(255) | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
email_id | lead_receive_emails.id | FK | cascade | LeadReceiveEmail::attachments() |
lead_email_templates ​
Lead email templates.
Model: LM\LeadEmailTemplate · Created in 2021_12_10_162628_create_lead_email_templates_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
title | varchar(255) | no | ||
subject | varchar(255) | no | ||
description | text | yes | ||
body | longtext | yes | ||
status | tinyint | no | 1 | Comment: 1 = Active, 0 = Inactive |
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | workspaces.id | FK | cascade | - |
Referenced by: lead_email_template_attachments.email_template_id.
lead_email_template_attachments ​
Attachments of a lead email template.
Model: LM\LeadEmailTemplateAttachment · Created in 2021_12_10_164153_create_lead_email_template_attachments_table.php · changed by 1 later migration: 2022_01_13_130629
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
email_template_id | bigint unsigned | no | FK → lead_email_templates.id | |
attachment | varchar(255) | no | ||
org_file_name | varchar(255) | no | Comment: Original file name | |
created_at | timestamp | yes | ||
updated_at | timestamp | yes | ||
url | varchar(255) | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
email_template_id | lead_email_templates.id | FK | cascade | LeadEmailTemplate::attachments() |
lead_email_signature ​
Lead email signature per workspace.
Model: LM\LeadEmailSignature · Created in 2021_12_14_150854_create_lead_email_signature_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
signature | longtext | no | ||
status | tinyint | no | 1 | Comment: 1=Active, 0=Inactive |
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | workspaces.id | FK | cascade | - |
smtps ​
SMTP settings for LM email per workspace.
Model: LM\Smtp · Created in 2021_12_07_154025_create_smtps_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
port | int | no | Comment: default post is 465 | |
encryption | varchar(255) | no | Comment: SSL, TLS | |
user | varchar(255) | no | Comment: SMTP account username | |
password | varchar(255) | no | Comment: SMTP account password | |
is_verified | int | no | 0 | Comment: 0 = Pending, 1 = Verified, 2 = Failed |
status | int | no | 1 | Comment: 1 = Active, 0 = Inactive |
Other columns: host, from_email, from_name, created_at, updated_at.
Indexes: smtps_workspace_id_unique unique (workspace_id).
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | workspaces.id | FK | cascade | - |
imaps ​
IMAP settings for LM inbound email per workspace.
Model: LM\Imap · Created in 2021_12_07_154523_create_imaps_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
port | int | no | Comment: default post is 993 | |
encryption | varchar(255) | no | Comment: SSL, TLS | |
protocol | varchar(255) | no | imap | Comment: Imap,pop3,nntp |
validate_cert | tinyint(1) | no | true | Comment: Imap validate certificate |
user | varchar(255) | no | Comment: imap account username | |
password | varchar(255) | no | Comment: imap account password | |
mailbox | varchar(255) | no | Comment: in most cases INBOX is the recommended value | |
is_verified | int | no | 0 | Comment: 0 = Pending, 1 = Verified, 2 = Failed |
status | int | no | 1 | Comment: 1 = Active, 0 = Inactive |
Other columns: host, created_at, updated_at.
Indexes: imaps_workspace_id_unique unique (workspace_id).
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | workspaces.id | FK | cascade | - |
verify_emails ​
Email verification tokens.
Model: LM\VerifyEmail · Created in 2021_07_02_151446_create_verify_emails_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
user_id | int | no | ||
token | varchar(255) | yes | ||
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
user_id | dealerships.id | Eloquent | - | VerifyEmail::dealership() |
Products ​
Solid lines are foreign keys in the migrations; dotted lines are relations that exist only in the models. Tables from other pages appear without their own section here.
products ​
Product catalogue. Soft deleted.
Model: LM\Product · Created in 2021_01_25_180632_create_products_table.php · changed by 1 later migration: 2022_01_24_134706 · soft deletes
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
category_id | bigint unsigned | yes | FK → categories.id | |
name | varchar(255) | no | ||
sku | varchar(255) | yes | ||
model | varchar(255) | yes | ||
price | varchar(255) | yes | ||
descrption | varchar(255) | yes | ||
is_active | tinyint | no | 1 | Comment: 1=Active, 0=Deactive |
created_at | timestamp | yes | ||
updated_at | timestamp | yes | ||
deleted_at | timestamp | yes | soft delete |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | workspaces.id | FK | cascade | - |
category_id | categories.id | FK | cascade | Category::product(), Product::category() |
Referenced by: dealership_products.product_id, lead_assign_dealerships.product_id, lead_products.product_id, lead_rsm_assigns.product_id, lead_tasks.product_id, product_alias.product_id, product_images.product_id, product_variant_options.product_id, product_variants.product_id.
categories ​
Product categories (tree via parent_id).
Model: LM\Category · Created in 2021_01_25_173236_create_categories_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
parent_id | bigint unsigned | yes | ||
name | varchar(255) | no | ||
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | workspaces.id | FK | cascade | - |
parent_id | categories.id | Eloquent | - | Category::subcategory(), Category::parent() |
Referenced by: dealership_products.category_id, dealership_rsm_assigns.category_id, lead_products.category_id, products.category_id.
product_images ​
Product images.
Model: LM\ProductImage · Created in 2021_01_25_185417_create_product_images_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
product_id | bigint unsigned | no | FK → products.id | |
uploaded_by | bigint unsigned | no | FK → users.id | |
display_file_name | varchar(255) | no | ||
file_name | varchar(255) | no | ||
file_type | varchar(255) | yes | ||
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | workspaces.id | FK | cascade | - |
product_id | products.id | FK | cascade | Product::productImages() |
product_id | dealership_products.product_id | Eloquent | - | DealershipProduct::productImages() (matches on dealership_products.product_id, which is not a key) |
uploaded_by | users.id | FK | cascade | - |
product_variants ​
Variants of a product.
Model: LM\ProductVariant · Created in 2021_01_26_115651_create_product_variants_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
product_id | bigint unsigned | no | FK → products.id | |
product_variants_types_id | bigint unsigned | yes | FK → product_variants_types.id | |
variant_name | varchar(255) | no | ||
is_active | tinyint | no | 1 | Comment: 1=Active, 0=Deactive |
sort_order | int | no | 1 | |
variant_custom_field_set | longtext | yes | ||
variant_display_options | longtext | yes | ||
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | workspaces.id | FK | cascade | - |
product_id | products.id | FK | cascade | Product::productVariants() |
product_id | lead_products.product_id | Eloquent | - | LeadProduct::productVariatdetails() (matches on lead_products.product_id, which is not a key) |
product_variants_types_id | product_variants_types.id | FK | cascade | - |
Referenced by: lead_products.variant_id, product_variant_options.variant_id.
product_variant_options ​
Options of a product variant.
Model: LM\ProductVariantOption · Created in 2021_01_26_120440_create_product_variant_options_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
product_id | bigint unsigned | no | FK → products.id | |
variant_id | bigint unsigned | no | FK → product_variants.id | |
option_name | varchar(255) | yes | ||
option_display_file_name | varchar(255) | yes | ||
file_name | varchar(255) | yes | ||
sort_order | int | no | 1 | |
variant_custom_field_set | longtext | yes | ||
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
product_id | products.id | FK | cascade | - |
variant_id | product_variants.id | FK | cascade | ProductVariant::productVariantOptions() |
Referenced by: lead_products.variant_option_id.
product_variants_types ​
Product variant types (catalogue).
Model: LM\ProductVariantsTypes · Created in 2021_01_15_132831_create_product_variants_types_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
type_name | varchar(255) | no | ||
status | enum(1,0) | no | 1 | Comment: 1=Active, 0=In-Active |
sort_order | int | yes | ||
created_by | bigint unsigned | no | FK → users.id | |
updated_by | bigint unsigned | no | FK → users.id | |
workspace_id | bigint unsigned | yes | FK → workspaces.id | |
custom_fields | longtext | yes | ||
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
created_by | users.id | FK | cascade | - |
updated_by | users.id | FK | cascade | - |
workspace_id | workspaces.id | FK | cascade | - |
Referenced by: product_variants.product_variants_types_id.
product_alias ​
Alternative product names.
Model: LM\ProductAlias · Created in 2021_12_30_173337_create_product_alias_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
product_id | bigint unsigned | yes | FK → products.id | |
name | varchar(255) | no | ||
is_active | tinyint | no | 1 | Comment: 1=Active, 0=Deactive |
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | workspaces.id | FK | cascade | - |
product_id | products.id | FK | cascade | ProductAlias::product(), Product::productAlias() |
CRM integrations, tracking and reference data ​
Solid lines are foreign keys in the migrations; dotted lines are relations that exist only in the models. Tables from other pages appear without their own section here.
workspace_leads_module_settings ​
LM settings per workspace (dashboard, auto assignment, CRM accounts).
Model: LM\WorkspaceLeadsModuleSetting · Created in 2022_03_25_111609_create_workspace_leads_module_settings_table.php · changed by 2 later migrations: 2022_04_11_133351, 2022_05_23_135159
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
executive_dashboard_status | tinyint | no | 0 | |
created_at | timestamp | yes | ||
updated_at | timestamp | yes | ||
automatic_lead_assignment | tinyint | no | 0 | |
is_mautic_account | tinyint | no | 0 | |
is_sharp_spring_account | tinyint | no | 0 |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | workspaces.id | FK | cascade | Workspace::LeadModuleSetting() |
sharp_spring_accounts ​
SharpSpring account credentials per workspace.
Model: LM\SharpSpringAccounts · Created in 2021_03_16_134803_create_sharp_spring_accounts_table.php · changed by 1 later migration: 2022_03_14_132934
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
account_name | varchar(255) | no | ||
account_id | varchar(255) | no | ||
account_secret | varchar(255) | no | ||
product_field_name | text | yes | ||
created_by | bigint unsigned | yes | ||
updated_by | bigint unsigned | yes | ||
created_at | timestamp | yes | ||
updated_at | timestamp | yes | ||
timezone | varchar(255) | no | UTC |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | workspaces.id | FK | cascade | - |
created_by | not declared | Column only | - | - |
updated_by | not declared | Column only | - | - |
sharp_spring_forms ​
SharpSpring forms per workspace.
Model: LM\SharpSpringForm · Created in 2021_03_09_122904_create_sharp_spring_forms_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
title | varchar(255) | no | ||
form_id | varchar(255) | no | ||
created_by | bigint unsigned | yes | FK → users.id | |
updated_by | bigint unsigned | yes | FK → users.id | |
status | enum(0,1) | no | 1 | Comment: 0= In Active, 1= Active |
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | workspaces.id | FK | cascade | - |
created_by | users.id | FK | cascade | - |
updated_by | users.id | FK | cascade | - |
Referenced by: sharp_spring_fields.sharp_spring_forms_id.
sharp_spring_fields ​
Fields of a SharpSpring form.
Model: LM\SharpSpringFields · Created in 2021_03_09_123205_create_sharp_spring_fields_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
sharp_spring_forms_id | bigint unsigned | no | FK → sharp_spring_forms.id | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
form_id | varchar(255) | no | ||
form_title | varchar(255) | no | ||
sharp_spring_field | varchar(255) | no | ||
created_by | bigint unsigned | yes | FK → users.id | |
updated_by | bigint unsigned | yes | FK → users.id | |
sort_order | int | yes | ||
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
sharp_spring_forms_id | sharp_spring_forms.id | FK | cascade | SharpSpringForm::SharpSpringFormField() |
workspace_id | workspaces.id | FK | cascade | - |
created_by | users.id | FK | cascade | - |
updated_by | users.id | FK | cascade | - |
sharp_spring_global_fields ​
SharpSpring field mapping per workspace.
Model: LM\SharpSpringGlobalFields · Created in 2021_11_08_184728_create_sharp_spring_global_fields_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
system_name | varchar(255) | no | ||
label | varchar(255) | no | ||
instance | varchar(255) | no | ||
isCustom | tinyint | no | 0 | Comment: 0=no, 1=Yes |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | workspaces.id | FK | cascade | - |
sharp_spring_column_fields ​
Default SharpSpring field list.
Model: LM\SharpSpringColumnFields · Created in 2021_11_09_104110_sharp_spring_column_fields.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
system_name | varchar(255) | no | ||
label | varchar(255) | no | ||
isCustom | tinyint | no | 0 | Comment: 0=no, 1=Yes |
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
sharp_spring_sync_leads_mappings ​
SharpSpring lead sync field mappings per workspace.
Model: LM\SharpSpringSyncLeadsMapping · Created in 2022_04_18_190151_create_sharp_spring_sync_leads_mappings_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
mappings | json | no | ||
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | workspaces.id | FK | cascade | - |
mautic_accounts ​
Mautic account credentials per workspace.
Model: LM\MauticAccount · Created in 2022_05_18_152709_create_mautic_accounts_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
account_name | varchar(255) | no | ||
account_id | varchar(255) | no | ||
account_secret | varchar(255) | no | ||
url_path | varchar(255) | no | ||
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | workspaces.id | FK | cascade | - |
mautic_forms ​
Mautic forms per workspace.
Model: LM\MauticForm · Created in 2022_05_18_152759_create_mautic_forms_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
title | varchar(255) | no | ||
form_id | varchar(255) | no | ||
status | enum(0,1) | no | 1 | Comment: 0= In Active, 1= Active |
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | workspaces.id | FK | cascade | - |
Referenced by: mautic_form_fields.mautic_forms_id.
mautic_form_fields ​
Fields of a Mautic form.
Model: LM\MauticFormField · Created in 2022_05_18_152852_create_mautic_form_fields_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
mautic_forms_id | bigint unsigned | no | FK → mautic_forms.id | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
form_id | varchar(255) | no | ||
field_name | varchar(255) | no | ||
slug | varchar(255) | no | ||
mautic_field | varchar(255) | no | ||
sort_order | int | yes | ||
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
mautic_forms_id | mautic_forms.id | FK | cascade | MauticForm::MauticFormField() |
workspace_id | workspaces.id | FK | cascade | - |
mautic_global_fields ​
Mautic field mapping per workspace.
Model: LM\MauticGlobalField · Created in 2022_05_18_155147_create_mautic_global_fields_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
system_name | varchar(255) | no | ||
label | varchar(255) | no | ||
isCustom | tinyint | no | 0 | Comment: 0=no, 1=Yes |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | workspaces.id | FK | cascade | - |
numverify ​
Numverify API key per workspace.
Model: LM\Numverify · Created in 2022_03_01_172342_create_numverifies_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
access_key | longtext | no | Comment: Numverify api access key | |
is_active | tinyint | no | 1 | Comment: 1 = Active, 0 = In-Active |
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | workspaces.id | FK | cascade | - |
twilio ​
Twilio credentials per workspace.
Model: LM\Twilio · Created in 2022_03_01_173037_create_twilios_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
sid | longtext | no | Comment: Twilio SID | |
auth_token | longtext | no | Comment: Twilio Auth Token | |
is_active | tinyint | no | 1 | Comment: 1 = Active, 0 = In-Active |
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | workspaces.id | FK | cascade | - |
forms ​
Website forms captured by the lead tracking script.
Model: LM\Form · Created in update/2023_11_07_124433_create_forms_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
workspace_id | bigint unsigned | no | FK → workspaces.id | |
name | varchar(255) | yes | NULL | |
attr_id | varchar(255) | yes | NULL | |
attr_name | varchar(255) | yes | NULL | |
attr_class | varchar(255) | yes | NULL | |
attr_method | varchar(255) | yes | NULL | |
attr_action | varchar(255) | yes | NULL | |
page_url | varchar(255) | yes | NULL | |
is_script_verified | tinyint | yes | 0 | |
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | workspaces.id | FK | cascade | - |
Referenced by: form_fields.form_id, leads.custom_form_id.
form_fields ​
Fields of a captured website form.
Model: LM\FormField · Created in update/2023_11_07_160140_create_form_fields_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
form_id | bigint unsigned | no | FK → forms.id | |
attr_id | varchar(255) | yes | NULL |
Other columns: attr_name, attr_class, attr_type, attr_multiple, tag, label, request_name, custom_field_name, created_at, updated_at.
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
form_id | forms.id | FK | cascade | FormField::form(), Form::fields() |
guest_users ​
Website visitors tracked by the lead script (browser and device data).
Model: LM\GuestUser · Created in update/2023_11_27_152139_create_guest_users_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
workspace_id | bigint unsigned | yes | NULL | FK → workspaces.id |
Other columns: uuid, ip, ips, user_agent, browser_name, browser_v_name, browser_engine, platform_family, platform_name, platform_version, device_type, device_family, device_model, referrer, is_bot, is_in_app, created_at, updated_at.
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | workspaces.id | FK | set null | - |
guest_visit_logs ​
Page visits of a tracked visitor.
Model: LM\GuestVisitLog · Created in update/2023_11_30_180254_create_guest_visit_logs_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
workspace_id | bigint unsigned | yes | NULL | |
ip | varchar(255) | yes | NULL | |
url | varchar(255) | yes | NULL | |
title | varchar(255) | yes | NULL | |
total_duration | bigint | yes | 0 | Comment: seconds |
total_duration_time | time | yes | ||
visits | json | yes | NULL | |
guest_user_id | bigint unsigned | yes | NULL | |
uuid | varchar(255) | yes | NULL | |
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | not declared (name suggests workspaces) | Column only | - | - |
guest_user_id | not declared (name suggests guest_users) | Column only | - | - |
contacts ​
Contacts captured per workspace.
Model: LM\Contact · Created in update/2023_12_07_151122_create_contacts_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
workspace_id | bigint unsigned | yes | NULL | |
first_name | varchar(255) | yes | NULL | |
last_name | varchar(255) | yes | NULL | |
email | varchar(255) | yes | NULL | |
phone | varchar(255) | yes | NULL | |
uuid | varchar(255) | yes | NULL | |
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
| Column | References | Type | On delete | Model relation |
|---|---|---|---|---|
workspace_id | not declared (name suggests workspaces) | Column only | - | - |
page_data ​
Page url and name pairs.
Model: LM\PageData · Created in 2021_07_26_142220_page_data.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
url | varchar(255) | yes | ||
name | varchar(255) | yes |
zipcodes ​
Zip code reference data (population and demographic columns).
Model: LM\ZipCode · Created in 2021_03_30_153915_create_table_for_zipode_manage.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment |
Other columns: ZipCode, PrimaryRecord, Population, HouseholdsPerZipcode, WhitePopulation, BlackPopulation, HispanicPopulation, AsianPopulation, HawaiianPopulation, IndianPopulation, OtherPopulation, MalePopulation, FemalePopulation, PersonsPerHousehold, AverageHouseValue, IncomePerHousehold, MedianAge, MedianAgeMale, MedianAgeFemale, Latitude, Longitude, Elevation, State, StateFullName, CityType, CityAliasAbbreviation, AreaCode, City, CityAliasName, County, CountyFIPS, StateFIPS, TimeZone, DayLightSaving, MSA, PMSA, CSA, CBSA, CBSA_DIV, CBSA_Type, CBSA_Name, MSA_Name, PMSA_Name, Region, Division, MailingName, NumberOfBusinesses, NumberOfEmployees, BusinessFirstQuarterPayroll, BusinessAnnualPayroll, BusinessEmploymentFlag, GrowthRank, GrowingCountiesA, GrowingCountiesB, GrowthIncreaseNumber, GrowthIncreasePercentage, CBSAPopulation, CBSADivisionPopulation, CongressionalDistrict, CongressionalLandArea, DeliveryResidential, DeliveryBusiness, DeliveryTotal, PreferredLastLineKey, ClassificationCode, MultiCounty, CSAName, CBSA_DIV_Name, CityStateKey, PopulationEstimate, LandArea, WaterArea, CityAliasCode, CityMixedCase, CityAliasMixedCase, BoxCount, SFDU, MFDU, StateANSI, CountyANSI, ZIPIntroDate, AliasIntroDate, FacilityCode, CityDeliveryIndicator, CarrierRouteRateSortation, FinanceNumber, UniqueZIPName, SSAStateCountyCode, MedicareCBSACode, MedicareCBSAName, MedicareCBSAType, MarketRatingAreaID, CountyMixedCase, country, created_at, updated_at.
zipcode_distances ​
Cached distances between two zip codes.
Model: LM\ZipcodeDistance · Created in 2021_03_18_121452_create_zip_code_distance_table.php
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
id | bigint unsigned | no | PK, auto increment | |
zipcode_one | varchar(255) | yes | ||
zipcode_two | varchar(255) | yes | ||
distance | varchar(255) | yes | ||
distance_value | bigint unsigned | yes | ||
time | varchar(255) | yes | ||
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
Related ​
- Database overview · All relationships
- Models: DAM models · Core models · LM models