Streamline · Database Schema

75 tables · 868 columns · generated 2026-05-26 ← API Reference

Authentication & Users

users 31 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK, auto-inc)no—Primary key
first_namevarchar(255)no—
last_namevarchar(255)yes—
emailvarchar(255)no—Originally unique; unique dropped, replaced by composite `(email, type)`
phonevarchar(255)no—Originally unique; unique dropped, replaced by composite `(phone, type)`
imagevarchar(255)yes—
two_factor_secrettextyes—
two_factor_recovery_codestextyes—
two_factor_confirmed_attimestampyes—
email_verified_attimestampyes—
typeenum('admin','vendor','customer','employee')no—`'employee'` added in 2025_10_05
model_idbigint unsignedyes—
passwordvarchar(255)yes—
activeintno1
reset_codevarchar(255)yes—
fcm_tokentextyes—Holds an Expo push token (`ExponentPushToken[…]`) despite the legacy column name
push_enabledbooleanno1Added 2026_06_15 — per-user master switch for all push notifications
live_activity_tokenvarchar(255)yes—Added 2026_06_20 — iOS Live Activity push-to-start token (after fcm_token)
remember_tokenvarchar(100)yes—
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
last_logintimestampyes—
birthdatedateyes—Added 2024_03_20_022951
country_idbigint unsignedyes—FK → countries.id (added 2024_03_20_022951)
city_idbigint unsignedyes—FK → cities.id
region_idbigint unsignedyes—FK → regions.id
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
providervarchar(255)yes—Added 2026_07_10 — social login: 'google' | 'apple'
provider_idvarchar(255)yes—Added 2026_07_10 — provider account id (indexed with provider)
is_super_adminbooleanno0Added 2026_06_30 — bypasses per-permission checks
Keys / indexes
  • created_by → users.id (onDelete not specified on original create; FK present)
  • updated_by → users.id
  • country_id → countries.id ON DELETE CASCADE
  • city_id → cities.id ON DELETE CASCADE
  • region_id → regions.id ON DELETE CASCADE
  • UNIQUE `(phone, type)` — original `phone` unique was dropped (2025_09_20)
  • UNIQUE `(email, type)` — original `email` unique was dropped (2025_09_25)

password_resets 3 cols

ColumnTypeNullDefaultNotes
emailvarchar(255)no—indexed
tokenvarchar(255)no—
created_attimestampyes—single column, not full timestamps
Keys / indexes
  • INDEX on `email`
  • No primary key.

failed_jobs 7 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK, auto-inc)no—Primary key
uuidvarchar(255)yes—UNIQUE, added 2026_04_04 (after id)
connectiontextno—
queuetextno—
payloadlongtextno—
exceptionlongtextno—
failed_attimestampnoCURRENT_TIMESTAMPuseCurrent
Keys / indexes
  • UNIQUE on `uuid`

cache 3 cols

ColumnTypeNullDefaultNotes
keyvarchar(255) (PK)no—Primary key
valuemediumtextno—
expirationintno—

cache_locks 3 cols

ColumnTypeNullDefaultNotes
keyvarchar(255) (PK)no—Primary key
ownervarchar(255)no—
expirationintno—

Lookups & Geography

categories 9 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
name_arvarchar(255)no—
name_envarchar(255)yes—
icontextyes—
is_activeenum('0','1')no1
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • created_by → users.id ON DELETE CASCADE
  • updated_by → users.id ON DELETE CASCADE

countries 9 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
name_arvarchar(255)no—
name_envarchar(255)yes—
codevarchar(255)yes—
is_activeenum('0','1')no0
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • created_by → users.id ON DELETE CASCADE; updated_by → users.id ON DELETE CASCADE

regions 9 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
name_arvarchar(255)no—
name_envarchar(255)yes—
is_activeenum('0','1')no1
country_idbigint unsignedyes—FK → countries.id
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • country_id → countries.id ON DELETE CASCADE
  • created_by / updated_by → users.id ON DELETE CASCADE

cities 9 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
name_arvarchar(255)no—
name_envarchar(255)yes—
is_activeenum('0','1')no0
region_idbigint unsignedyes—FK → regions.id
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • region_id → regions.id ON DELETE CASCADE
  • created_by / updated_by → users.id ON DELETE CASCADE

service_categories 12 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
name_arvarchar(255)no—
name_envarchar(255)yes—
icontextyes—
typeenum('main','sub')no—
is_activeenum('0','1')no1
category_idbigint unsignedyes—FK → categories.id
main_service_category_idbigint unsignedyes—self FK → service_categories.id
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • category_id → categories.id ON DELETE CASCADE
  • main_service_category_id → service_categories.id ON DELETE CASCADE (self-reference)
  • created_by / updated_by → users.id ON DELETE CASCADE

cancellation_reasons 8 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
reason_artextno—
reason_entextyes—
is_activeenum('0','1')no1
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • created_by / updated_by → users.id ON DELETE CASCADE

client_cancellation_reasons 10 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
reason_artextno—
reason_entextyes—
vendor_idbigint unsignedyes—FK → vendors.id, ON DELETE SET NULL (added 2026_05_26)
sorttinyintno0Added 2026_05_26 (after vendor_id)
is_activeenum('0','1')no1
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • vendor_id → vendors.id ON DELETE SET NULL
  • created_by / updated_by → users.id ON DELETE CASCADE
  • INDEX `ccr_vendor_active_sort_idx` on `(vendor_id, is_active, sort)`

Vendors, Branches, Employees

vendors 22 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
namevarchar(255)no—
commercial_novarchar(255)no—
tax_numbervarchar(255)yes—
descriptionlongtextyes—
website_urlvarchar(255)yes—
twittervarchar(255)yes—Retired 2026_06 — column kept, no longer read/written
instagramvarchar(255)yes—
snapchatvarchar(255)yes—Retired 2026_06 — column kept, no longer read/written
tiktokvarchar(255)yes—Added 2026_06_23 — replaces twitter/snapchat
is_activeenum('0','1')no0
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
seller_name_envarchar(255)yes—ZATCA, added 2026_01_14
seller_name_arvarchar(255)yes—ZATCA
addressvarchar(255)yes—ZATCA
zatca_environmentenum('sandbox','production')no'sandbox'
zatca_registeredboolean (tinyint 1)no0 (false)
zatca_statusenum('not_compliant','in_progress','compliant')no'not_compliant'
zatca_activeboolean (tinyint 1)no0 (false)
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • created_by / updated_by → users.id ON DELETE CASCADE

vendor_categories 8 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
is_activeenum('0','1')no1
vendor_idbigint unsignedyes—FK → vendors.id
category_idbigint unsignedyes—FK → categories.id
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • vendor_id → vendors.id ON DELETE CASCADE; category_id → categories.id ON DELETE CASCADE
  • created_by / updated_by → users.id ON DELETE CASCADE

vendor_branches 16 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
name_arvarchar(255)no—
name_envarchar(255)yes—
addressvarchar(255)yes—
imagevarchar(255)yes—
latvarchar(255)yes—
longvarchar(255)yes—
is_activeenum('0','1')no0
vendor_idbigint unsignedyes—FK → vendors.id
country_idbigint unsignedyes—FK → countries.id
city_idbigint unsignedyes—FK → cities.id
region_idbigint unsignedyes—FK → regions.id
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • vendor_id → vendors.id; country_id → countries.id; city_id → cities.id; region_id → regions.id; created_by / updated_by → users.id — all ON DELETE CASCADE

branches 31 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
namevarchar(255)no—
slugvarchar(255)yes—indexed; added 2025_12_11 (after name)
addressvarchar(255)yes—
imagevarchar(255)yes—
latvarchar(255)yes—
longvarchar(255)yes—
is_activeenum('0','1')no0
show_ratesenum('0','1')no0
manager_idbigint unsignedyes—FK → users.id
vendor_idbigint unsignedyes—FK → vendors.id
country_idbigint unsignedyes—FK → countries.id
city_idbigint unsignedyes—FK → cities.id
region_idbigint unsignedyes—FK → regions.id
ratedecimal(8,2)no5Added 2025_12_10 (after region_id)
bookingsintno0Added 2025_12_10 (after rate)
views_countintno0Added 2025_12_11 (after bookings)
national_addressvarchar(255)yes—Added 2025_01_06
home_pricing_typeenum('fixed','by_distance')no'fixed'Added 2026_06_22 — home-delivery fee model
home_fixed_feedecimal(8,2)no0Added 2026_06_22 — flat fee when pricing = fixed
offers_home_servicesbooleanno0Added 2026_06_23 — branch delivers to home
is_cloudbooleanno0Added 2026_06_23 — home-only (cloud) branch; implies offers_home_services
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
google_place_idvarchar(255)yes—Added 2026_06_26 — linked Google Place
google_ratingdecimal(2,1)yes—Added 2026_06_26 — synced Google rating
google_user_ratings_totalint unsignedyes—Added 2026_06_26
google_synced_attimestampyes—Added 2026_06_26
show_google_reviewsbooleanno0Added 2026_06_26 — expose live Google reviews on the storefront
Keys / indexes
  • manager_id → users.id; vendor_id → vendors.id; country_id → countries.id; city_id → cities.id; region_id → regions.id; created_by / updated_by → users.id — all ON DELETE CASCADE
  • INDEX on `slug`

branch_home_pricing_tiers 6 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
branch_idbigint unsignedno—FK → branches.id ON DELETE CASCADE
up_to_minutessmallint unsignedno—Upper bound of one-way driving minutes for this tier
feedecimal(8,2)no0Fee for trips within this tier
created_at / updated_attimestampyes—Timestamps
Keys / indexes
  • Composite index (branch_id, up_to_minutes) · Added 2026_06_22

branch_images 8 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
branch_idbigint unsignedno—FK → branches.id
imagevarchar(255)no—
is_activeenum('0','1')no1
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • branch_id → branches.id ON DELETE CASCADE; created_by / updated_by → users.id ON DELETE CASCADE

branch_views 5 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
branch_idbigint unsignedno—FK → branches.id
user_idbigint unsignedyes—FK → users.id
device_tokenvarchar(255)yes—
created_at / updated_attimestampyes—Timestamps
Keys / indexes
  • branch_id → branches.id (default FK, no explicit onDelete)
  • user_id → users.id (default FK)
  • No soft deletes.

favourites 7 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
branch_idbigint unsignedno—FK → branches.id
user_idbigint unsignedyes—FK → users.id
device_tokenvarchar(255)yes—
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps
Keys / indexes
  • branch_id → branches.id; user_id → users.id; created_by → users.id; updated_by → users.id (default FKs, no explicit onDelete)
  • No soft deletes.

official_hours 12 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
start_timetimeno—
end_timetimeno—
dayvarchar(255)no—
typeenum('work','break')no'work'
model_typetinyintno—polymorphic discriminator
is_activeenum('0','1')no1
model_idbigint unsignedyes—polymorphic id (no FK)
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • created_by / updated_by → users.id ON DELETE CASCADE

employees 17 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
user_idbigint unsignedno—FK → users.id
vendor_idbigint unsignedno—FK → vendors.id
salarydecimal(8,2)yes—default Laravel decimal precision (8,2)
start_datedateyes—
end_datedateyes—
is_activeenum('0','1')no1
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
job_titlevarchar(255)yes—Added 2024_09_06
biotextyes—Added 2026_05_28 — replaces earlier bio_ar/bio_en split (unified 2026_05_29)
commission_typeenum('none','fixed','percentage')no'none'Added 2025_11_25
commissiondecimal(8,2)no0Added 2025_11_25
commission_calculation_methodenum('gross','net')no'gross'Added 2025_11_25
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
google_calendar_idvarchar(255)yes—Added 2026_06_28 — employee's dedicated Google calendar
Keys / indexes
  • vendor_id → vendors.id ON DELETE CASCADE; user_id → users.id ON DELETE CASCADE; created_by / updated_by → users.id ON DELETE CASCADE

employee_portfolio_images 10 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
employee_idbigint unsignedno—FK → employees.id
imagevarchar(255)no—Storage path (e.g. images/employees/portfolio/<file>)
captiontextyes—Optional lightbox label
sorttinyint unsignedno0Display order (lowest first)
is_activeenum('0','1')no1Toggle visibility to customers
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • employee_id → employees.id ON DELETE CASCADE; created_by / updated_by → users.id ON DELETE CASCADE
  • Composite index (employee_id, is_active, sort) for the customer profile hot-path
  • Added 2026_05_28

employee_services 7 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
employee_idbigint unsignedno—FK → employees.id
service_idbigint unsignedno—FK → services.id
is_activeenum('0','1')no1
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps (NO soft deletes)
Keys / indexes
  • service_id → services.id ON DELETE CASCADE; employee_id → employees.id ON DELETE CASCADE; created_by / updated_by → users.id ON DELETE CASCADE

employee_branches 7 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
employee_idbigint unsignedno—FK → employees.id
branch_idbigint unsignedno—FK → branches.id
is_activeenum('0','1')no1
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps (NO soft deletes)
Keys / indexes
  • branch_id → branches.id ON DELETE CASCADE; employee_id → employees.id ON DELETE CASCADE; created_by / updated_by → users.id ON DELETE CASCADE

Sections, Services, Offers

sections 13 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
name_arvarchar(255)no—
name_envarchar(255)yes—
description_arlongtextyes—
description_enlongtextyes—
imagevarchar(255)yes—Made nullable in 2025_05_26
is_activeenum('0','1')no1
sortintno0Added 2026_05_20 (after is_active)
vendor_idbigint unsignedno—FK → vendors.id
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • vendor_id → vendors.id ON DELETE CASCADE; created_by / updated_by → users.id ON DELETE CASCADE

services 24 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
name_arvarchar(255)no—
name_envarchar(255)yes—
description_arlongtextyes—
description_enlongtextyes—
vendor_idbigint unsignedno—FK → vendors.id
section_idbigint unsignedno—FK → sections.id
category_idbigint unsignedyes—FK → service_categories.id. Made nullable 2025_05_12
sub_category_idbigint unsignedyes—FK → service_categories.id
pricedecimal(8,2)yes—
service_timedecimal(8,2)yes—
extra_timedecimal(8,2)yes—
featuredenum('0','1')no0
is_home_serviceboolean (tinyint 1)no0 (false)Added 2026_05_25 (after featured)
home_service_feedecimal(8,2)no0Added 2026_05_25 (after is_home_service)
home_onlybooleanno0Added 2026_06_23 — hide from in-branch storefront, home mode only
discount_typeenum('0','1')no0
discountdecimal(8,2)yes—
is_activeenum('0','1')no1
sortintno0Added 2026_05_20 (after is_active)
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • vendor_id → vendors.id; section_id → sections.id; category_id → service_categories.id; sub_category_id → service_categories.id; created_by / updated_by → users.id — all ON DELETE CASCADE

service_branches 8 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
service_idbigint unsignedno—FK → services.id
branch_idbigint unsignedno—FK → branches.id
is_activeenum('0','1')no1
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes added 2025_12_25
Keys / indexes
  • branch_id → branches.id ON DELETE CASCADE; service_id → services.id ON DELETE CASCADE; created_by / updated_by → users.id ON DELETE CASCADE

service_home_hours 6 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
service_idbigint unsignedno—FK → services.id
dayenum('sat','sun','mon','tue','wed','thu','fri')no—
start_timetimeno—
end_timetimeno—
created_at / updated_attimestampyes—Timestamps (NO soft deletes)
Keys / indexes
  • service_id → services.id ON DELETE CASCADE
  • INDEX `svc_home_hours_svc_day_idx` on `(service_id, day)`

offers 22 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
name_arvarchar(255)no—
name_envarchar(255)yes—
description_enlongtextyes—
description_arlongtextyes—
vendor_idbigint unsignedyes—FK → vendors.id
section_idbigint unsignedno—FK → sections.id
category_idbigint unsignedyes—FK → service_categories.id. Made nullable 2025_06_04
sub_category_idbigint unsignedyes—FK → service_categories.id
service_pricedecimal(10,2)yes—
price_typeenum('service','free','special','discount')no'service'
discount_percentagedecimal(8,2)yes—
offer_pricedecimal(8,2)yes—
is_home_servicebooleanno0Added 2026_05_30 — home-delivery opt-in (after offer_price)
home_service_feedecimal(8,2)no0Added 2026_05_30 — additive per-item home surcharge (summed across the bundle)
home_onlybooleanno0Added 2026_06_23 — hide from in-branch storefront, home mode only
is_activeenum('0','1')no1
sortintno0Added 2026_05_20 (after is_active)
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
deleted_attimestampyes—Soft deletes
created_at / updated_attimestampyes—Timestamps
Keys / indexes
  • vendor_id → vendors.id; section_id → sections.id; category_id → service_categories.id; sub_category_id → service_categories.id; created_by / updated_by → users.id — all ON DELETE CASCADE

offer_home_hours 6 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
offer_idbigint unsignedno—FK → offers.id ON DELETE CASCADE
dayenum('sat','sun','mon','tue','wed','thu','fri')no—
start_timetimeno—
end_timetimeno—
created_at / updated_attimestampyes—Timestamps (NO soft deletes)
Keys / indexes
  • Composite index (offer_id, day) · Added 2026_05_30 (mirror of service_home_hours)

sub_services 13 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
service_idbigint unsignedno—FK → services.id ON DELETE CASCADE
name_arvarchar(255)no—
name_envarchar(255)yes—
pricedecimal(8,2)no—Variant price
service_timedecimalno—Variant duration (minutes)
extra_timedecimalyes—Buffer minutes
sortintno0
is_activeenum('0','1')no1
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • Composite index (service_id, sort) · Added 2026_06_25 — per-service variants (sub-services)

vendor_google_calendars 9 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
vendor_idbigint unsignedno—UNIQUE — one connection per vendor
google_emailvarchar(255)yes—
access_tokentextyes—OAuth token
refresh_tokentextyes—
token_expires_attimestampyes—
default_calendar_idvarchar(255)yes—
sync_enabledbooleanno1
created_at / updated_attimestampyes—Timestamps
Keys / indexes
  • Added 2026_06_28 — two-way Google Calendar sync

google_review_snapshots 17 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
branch_idbigint unsignedno—UNIQUE FK → branches.id
place_idvarchar(255)no—
place_namevarchar(255)yes—
total_scoredecimal(2,1)yes—Google rating
reviews_countint unsignedyes—
reviewsjsonyes—Raw review payloads
fetched_attimestampyes—
categoryvarchar(255)yes—Added 2026_06_29 (competitors)
latdecimal(10,7)yes—
lngdecimal(10,7)yes—
competitorsjsonyes—Nearby competitor list
employee_mentionsjsonyes—Mined employee mentions from reviews
employee_mentions_attimestampyes—
competitor_insightsjsonyes—AI competitor insights
competitor_insights_attimestampyes—
created_at / updated_attimestampyes—Timestamps
Keys / indexes
  • Added 2026_06_29 (+3 follow-ups) — Google review intelligence per branch

integrations 11 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
keyvarchar(255)no—UNIQUE slug (whatsapp, oursms, google, apify, live_activity, gemini)
namevarchar(255)no—
groupvarchar(255)yes—messaging | maps | reviews | push | ai
config_keyvarchar(255)yes—Dot-path config overlay
iconvarchar(255)yes—
fieldsjsonyes—[{key, label, secret, required}]
credentialstextyes—Encrypted array
is_activebooleanno1
sortintno0
created_at / updated_attimestampyes—Timestamps
Keys / indexes
  • Added 2026_06_30 — admin-managed third-party integrations

default_sections 9 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
name_arvarchar(255)no—
name_envarchar(255)yes—
description_artextyes—
description_entextyes—
sortintno0
is_activebooleanno1
deleted_attimestampyes—Soft deletes (added 2026_06_30)
created_at / updated_attimestampyes—Timestamps
Keys / indexes
  • Added 2026_06_30 — section templates seeded into new vendors (was hardcoded)

offer_services 7 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
offer_idbigint unsignedno—FK → offers.id
service_idbigint unsignedno—FK → services.id
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps (NO soft deletes)
sub_service_idbigint unsignedyes—Added 2026_06_25 — variant pinned in the offer; FK → sub_services.id ON DELETE SET NULL
Keys / indexes
  • offer_id → offers.id ON DELETE CASCADE; service_id → services.id ON DELETE CASCADE; created_by / updated_by → users.id ON DELETE CASCADE

Bookings & Reviews

bookings 40 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
attendanceenum('0','1')no1
booking_daydateyes—
booking_timetimeyes—
start_timetimestampyes—Added 2025_07_10 (after booking_time)
end_timetimestampyes—Added 2025_07_10 (after start_time)
future_bookingenum('0','1')no'0'Added 2025_11_17 (after end_time)
sub_totaldecimal(8,2)no0
discountdecimal(8,2)no0
totaldecimal(8,2)no0
vatdecimal(8,2)no—Added 2025_07_16 (after total), NOT NULL no default
employee_commissiondecimal(8,2)no0Added 2025_11_26 (after vat)
statusenum('confirmed','not_confirmed','completed','not_available','canceled','missed')no'not_confirmed'See history note below
payment_wayenum('online','cash')no'cash'
promo_code_valuedecimal(8,2)yes—Renamed from `promocode_value` (2025_06_16)
promo_code_idbigint unsignedyes—Renamed from `promocode_id`; FK → promo_codes.id
noteslongtextyes—
cancellation_reasontextyes—Added 2026_05_25 (after notes)
canceled_byenum('customer','vendor','system')yes—Added 2026_05_25 (after cancellation_reason)
cancel_reason_idbigint unsignedyes—FK → client_cancellation_reasons.id, ON DELETE SET NULL (added 2026_05_26, after canceled_by)
is_home_serviceboolean (tinyint 1)no0 (false)Added 2026_05_25 (after canceled_by)
customer_latdecimal(10,7)yes—Added 2026_05_25
customer_lngdecimal(10,7)yes—Added 2026_05_25
transit_minutesint unsignedyes—Added 2026_05_25
customer_addressvarchar(500)yes—Added 2026_05_25
vendor_idbigint unsignedno—FK → vendors.id
user_idbigint unsignedyes—FK → users.id. Made nullable 2025_09_12
offer_idbigint unsignedyes—FK → offers.id
employee_idbigint unsignedyes—FK → employees.id
branch_idbigint unsignedyes—Added 2024_05_11 (no FK declared)
customer_invoicebigint unsignedyes—Added 2024_05_11 (no FK)
vendor_invoicebigint unsignedyes—Added 2024_05_11 (no FK)
confirmationenum('confirmed','not_confirmed')no'confirmed'Added 2024_12_10
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
payment_statusenum('0','1')no0
is_activeenum('0','1')no1
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
google_event_idvarchar(255)yes—Added 2026_06_28 — synced Google Calendar event
Keys / indexes
  • promo_code_id → promo_codes.id ON DELETE CASCADE
  • vendor_id → vendors.id ON DELETE CASCADE
  • offer_id → offers.id ON DELETE CASCADE
  • user_id → users.id ON DELETE CASCADE
  • employee_id → employees.id ON DELETE CASCADE
  • cancel_reason_id → client_cancellation_reasons.id ON DELETE SET NULL
  • created_by / updated_by → users.id ON DELETE CASCADE
  • NOTE: `branch_id`, `customer_invoice`, `vendor_invoice` are plain columns with NO foreign key constraints.

booking_services 12 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
booking_idbigint unsignedno—FK → bookings.id
service_idbigint unsignedno—FK → services.id
offer_idbigint unsignedyes—FK → offers.id (added 2025_07_15, after service_id)
pricedecimal(8,2)no0
vatdoubleno—Added 2025_07_15 (after price), NOT NULL no default
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
deleted_attimestampyes—Soft deletes
created_at / updated_attimestampyes—Timestamps
sub_service_idbigint unsignedyes—Added 2026_06_25 — chosen variant; FK → sub_services.id ON DELETE SET NULL
service_timeint unsignedyes—Added 2026_07_07 — per-line duration override (minutes)
Keys / indexes
  • service_id → services.id ON DELETE CASCADE; booking_id → bookings.id ON DELETE CASCADE; created_by / updated_by → users.id ON DELETE CASCADE
  • offer_id → offers.id (no explicit onDelete)

booking_updates 7 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
booking_idbigint unsignedno—FK → bookings.id
statusvarchar(255)no—
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • booking_id → bookings.id; created_by → users.id; updated_by → users.id (default FKs, no explicit onDelete)

reviews 9 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
employee_ratetinyintno1
employee_commenttextyes—
booking_idbigint unsignedno—FK → bookings.id
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
is_activeenum('0','1')no1
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • booking_id → bookings.id ON DELETE CASCADE; created_by / updated_by → users.id ON DELETE CASCADE

review_reports 8 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
commenttextyes—
review_idbigint unsignedno—FK → reviews.id
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
is_activeenum('0','1')no1
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • review_id → reviews.id ON DELETE CASCADE; created_by / updated_by → users.id ON DELETE CASCADE

Invoicing & ZATCA

tax_invoices 13 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
typeenum('service','product')no—
costfloatyes—
booking_idbigint unsignedyes—FK → bookings.id
product_idbigint unsignedyes—no FK
namevarchar(255)yes—
emailvarchar(255)yes—
phonevarchar(255)yes—
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
is_activeenum('0','1')no1
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • booking_id → bookings.id ON DELETE CASCADE; created_by / updated_by → users.id ON DELETE CASCADE

invoices 32 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
uuidchar(36)no—UNIQUE (Laravel `uuid()` default column name `uuid`)
invoice_numbervarchar(255)no—UNIQUE
document_typevarchar(20)no'invoice'Added 2026_06_24 — invoice | credit_note | debit_note
reference_invoice_idbigint unsignedyes—Added 2026_06_24 — original invoice a note adjusts
note_reasonvarchar(255)yes—Added 2026_06_24 — reason for credit/debit note
buyer_namevarchar(255)no—
buyer_vat_numbervarchar(255)yes—
seller_namevarchar(255)no—
seller_vat_numbervarchar(255)yes—
totaldecimal(8,2)no—
vatdecimal(8,2)no—
qr_code_base64longtextno—
typeenum('customer','vendor')no—
booking_idbigint unsignedyes—FK → bookings.id
vendor_idbigint unsignedno—FK → vendors.id
zatca_statusenum('pending','skipped','reported','cleared','failed')no'pending'Added 2026_05_25 (after vendor_id); INDEXED
zatca_environmentenum('sandbox','production')yes—
icvint unsignedyes—per-vendor counter
pihvarchar(100)yes—previous invoice hash
hashvarchar(100)yes—this invoice hash
zatca_uuidchar(36)yes—
signed_xmllongtextyes—
zatca_qr_base64longtextyes—
zatca_responsejsonyes—
zatca_warningsjsonyes—
zatca_errorsjsonyes—
zatca_attemptstinyint unsignedno0
cleared_attimestampyes—
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps (NO soft deletes)
Keys / indexes
  • booking_id → bookings.id; vendor_id → vendors.id; created_by / updated_by → users.id — all ON DELETE CASCADE
  • UNIQUE on `uuid`; UNIQUE on `invoice_number`
  • UNIQUE `invoices_vendor_icv_unique` on `(vendor_id, icv)`
  • INDEX on `zatca_status`

zatca_egs 6 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
vendor_idbigint unsignedno—FK → vendors.id
environmentenum('sandbox','production')no'sandbox'
csrlongtextno—
private_keylongtextno—
created_at / updated_attimestampyes—Timestamps
Keys / indexes
  • vendor_id → vendors.id (default FK, no explicit onDelete)

zatca_credentials 8 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
egs_idbigint unsignedno—FK → zatca_egs.id
request_idbigintno—signed bigint
certificatelongtextno—
api_secretlongtextno—
icvintyes—
pihvarchar(255)yes—
created_at / updated_attimestampyes—Timestamps
Keys / indexes
  • egs_id → zatca_egs.id (default FK, no explicit onDelete)

Wallets & Promotions

wallets 8 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
user_idbigint unsignedno—FK → users.id
balancefloatno0
is_activeenum('0','1')no1
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • user_id → users.id ON DELETE CASCADE; created_by / updated_by → users.id ON DELETE CASCADE

wallet_transactions 13 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
wallet_idbigint unsignedno—FK → wallets.id
valuefloatno0
description_entextyes—Renamed from `description` (2025_09_23)
description_artextyes—Added 2025_09_23
typeenum('debit','credit')no'debit'
is_activeenum('0','1')no1
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
branch_idbigint unsignedyes—FK → branches.id (added 2025_01_06)
booking_idbigint unsignedyes—FK → bookings.id (added 2025_11_24)
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • wallet_id → wallets.id ON DELETE CASCADE; created_by / updated_by → users.id ON DELETE CASCADE
  • branch_id → branches.id ON DELETE CASCADE; booking_id → bookings.id ON DELETE CASCADE

promo_codes 15 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
discount_typeenum('percentage','fixed')no'percentage'
category_typeenum('public','private')no'public'
valuefloatno1
codevarchar(255)no—
start_datevarchar(255)no—stored as string
end_datevarchar(255)no—stored as string
user_idbigint unsignedyes—FK → users.id
usesintno1
actual_usesintno0Added 2026_03_04 (after uses)
is_activeenum('0','1')no1
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • user_id → users.id ON DELETE CASCADE; created_by / updated_by → users.id ON DELETE CASCADE

Packages & Subscriptions

packages 32 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
name_arvarchar(255)no—
name_envarchar(255)yes—
description_artextno—
description_entextyes—
periodenum('unknown','days','month','quarter','half_year','year')no'unknown'
daysintyes—
unknown_pricefloatno0
days_pricefloatno0
month_pricefloatno0
quarter_pricefloatno0
half_year_pricefloatno0
year_pricefloatno0
typeenum('public','private')no'public'
manager_role_idbigint unsignedyes—no FK
subscription_typeenum('subscribe','commission','subscribe_and_commission')no'subscribe'
commissionfloatno0
featurestextyes—
sms_messagesintno0
whatsapp_messagesintno0
is_defaultenum('0','1')no1
policytextyes—
is_activeenum('0','1')no1
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
branchesintno1Added 2024_03_31
employeesintno1Added 2024_03_31
customersintno1Added 2024_03_31
paymentsenum('cash','percentage','cash_and_percentage')no'cash'Added 2024_03_31; enum expanded 2025_01_06
remove_copy_rightenum('0','1')no0Added 2024_03_31
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • created_by / updated_by → users.id ON DELETE CASCADE

subscriptions 27 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
name_arvarchar(255)no—
package_idbigint unsignedno—FK → packages.id
vendor_idbigint unsignedno—FK → vendors.id
periodenum('unknown','days','month','quarter','half_year','year')no'unknown'
subscription_typeenum('subscribe','commission','subscribe_and_commission')no'subscribe'
daysintyes—
pricefloatno0
start_datevarchar(255)yes—string
end_datevarchar(255)yes—string
payment_datevarchar(255)yes—string
commissionfloatno0
sms_messagesintno0
whatsapp_messagesintno0
auto_renewenum('0','1')no1
statusenum('pending','wait_payment','cancelled','finished','expanded','renewed','suspended','active')no'pending'
is_activeenum('0','1')no1
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
branchesintno1Added 2024_03_31
employeeintno1Added 2024_03_31 (note: singular `employee`)
customersintno1Added 2024_03_31
paymentsenum('cash','percentage','cash_and_percentage')no'cash'Added 2024_03_31; enum expanded 2025_05_11
remove_copy_rightenum('0','1')no0Added 2024_03_31
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
featuresjsonyes—Added 2026_06_30 — feature keys copied from the package at purchase (gates checkFeature middleware)
Keys / indexes
  • package_id → packages.id ON DELETE CASCADE; vendor_id → vendors.id ON DELETE CASCADE; created_by / updated_by → users.id ON DELETE CASCADE

Settings

payment_settings 8 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
online_paymentenum('0','1')no1
online_on_delivery_paymentenum('0','1')no1
is_activeenum('0','1')no1
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • created_by / updated_by → users.id ON DELETE CASCADE

service_settings 7 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
difference_in_minintno15
is_activeenum('0','1')no1
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • created_by / updated_by → users.id ON DELETE CASCADE

tax_settings 7 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
tax_percentageintno0
is_activeenum('0','1')no1
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • created_by / updated_by → users.id ON DELETE CASCADE

notification_settings 10 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
emailenum('0','1')no1
smsenum('0','1')no1
whatsappenum('0','1')no1
is_activeenum('0','1')no1
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
pushvarchar(255)no1Added 2026_06_30 — platform-level push channel toggle
Keys / indexes
  • created_by / updated_by → users.id ON DELETE CASCADE

user_notification_settings 9 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
emailenum('0','1')no1
smsenum('0','1')no1
whatsappenum('0','1')no1
is_activeenum('0','1')no1
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • created_by / updated_by → users.id ON DELETE CASCADE

language_settings 8 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
defaultenum('en','ar')no'ar'
is_activeenum('0','1')no1
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
user_idbigint unsignedyes—Added 2024_03_28 (no FK)
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • created_by / updated_by → users.id ON DELETE CASCADE. `user_id` has NO FK.

vendor_settings 18 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
stock_alerttinyintno1
calender_differancetinyintno10
calender_differance_typeenum('fixed','vary')no'fixed'
booking_differancetinyintno30Default changed from 1 → 30 (2025_05_07)
booking_rangeenum('one_month',...,'twelve_month')no'one_month'12 values: one_month, two_month, three_month, four_month, five_month, six_month, seven_month, eight_month, nine_month, ten_month, eleven_month, twelve_month
cancel_bookingtinyintno1
reschedule_bookingtinyintno1
reviews_enabledtinyintno1Added 2026_05_26 (after reschedule_booking)
vendor_idbigint unsignedyes—FK → vendors.id
is_systemenum('0','1')no0
is_activeenum('0','1')no1
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
accept_paymentenum('cash','online','both')no'both'Added 2024_09_21
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
google_reviews_min_starstinyint unsignedno5Added 2026_06_27 — hide storefront Google reviews below this rating
Keys / indexes
  • vendor_id → vendors.id ON DELETE CASCADE; created_by / updated_by → users.id ON DELETE CASCADE

Content & Misc

system_notifications 12 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
messagetextno—
sender_idbigint unsignedyes—FK → users.id
receiver_idbigint unsignedyes—FK → users.id
urlvarchar(255)yes—
is_readenum('0','1')no0
is_activeenum('0','1')no1
is_systemenum('0','1')no0
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • sender_id / receiver_id / created_by / updated_by → users.id ON DELETE CASCADE

help_centers 10 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
titlevarchar(255)no—
descriptiontextyes—
imagetextyes—
videotextno—NOT NULL
is_activeenum('0','1')no1
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • created_by / updated_by → users.id ON DELETE CASCADE

term_conditions 9 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
contentlongtextno—
is_activeenum('0','1')no1
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
is_systemenum('0','1')no0Added 2024_03_28
vendor_idbigint unsignedyes—Added 2024_03_28 (no FK)
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • created_by / updated_by → users.id ON DELETE CASCADE. `vendor_id` has NO FK.

privacy_policies 9 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
contentlongtextno—
is_activeenum('0','1')no1
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
is_systemenum('0','1')no0Added 2024_03_28
vendor_idbigint unsignedyes—Added 2024_03_28 (no FK)
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • created_by / updated_by → users.id ON DELETE CASCADE. `vendor_id` has NO FK.

f_a_q_s 8 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
questiontextno—
answertextno—
is_activeenum('0','1')no1
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • created_by / updated_by → users.id ON DELETE CASCADE

contact_messages 10 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
messagetextno—
namevarchar(255)no—
emailvarchar(255)yes—
is_readenum('0','1')no0
is_activeenum('0','1')no1
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • created_by / updated_by → users.id ON DELETE CASCADE

banners 10 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
titlevarchar(255)yes—
descriptionvarchar(255)yes—
urlvarchar(255)yes—
imagevarchar(255)no—NOT NULL
is_activeenum('0','1')no1
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
Keys / indexes
  • created_by / updated_by → users.id ON DELETE CASCADE

Reminders

reminder_channels 7 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
vendor_idbigint unsignedno—FK → vendors.id
email_enabledboolean (tinyint 1)no1 (true)
sms_enabledboolean (tinyint 1)no1 (true)
whatsapp_enabledboolean (tinyint 1)no1 (true)
push_enabledboolean (tinyint 1)no1 (true)
created_at / updated_attimestampyes—Timestamps
Keys / indexes
  • vendor_id → vendors.id (default FK, no explicit onDelete)

reminders 22 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
typeenum('reminder','alert')no'alert'
event_typeenum('new_booking','rescheduled_booking','cancelled_booking','customer_did_not_show_up','completed_booking','new_booking_reminder')no—
sortintno—NOT NULL no default
iconvarchar(255)yes—
namevarchar(255)no—
descriptiontextno—
contentlongtextno—
durationintno0
is_activeboolean (tinyint 1)no1 (true)
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
content_pushlongtextyes—Added 2026_06_07 — per-channel template (falls back to content)
content_smslongtextyes—Added 2026_06_07
content_whatsapplongtextyes—Added 2026_06_07
content_emaillongtextyes—Added 2026_06_07
email_enabledbooleanno1Added 2026_06_07 — channel flag
sms_enabledbooleanno1Added 2026_06_07
whatsapp_enabledbooleanno1Added 2026_06_07
push_enabledbooleanno1Added 2026_06_07
Keys / indexes
  • created_by → users.id; updated_by → users.id (default FKs)
  • UNIQUE `(type, event_type)`

vendor_reminders 18 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK)no—
vendor_idbigint unsignedno—FK → vendors.id
reminder_idbigint unsignedno—FK → reminders.id
contentlongtextno—
durationintno0
email_enabledboolean (tinyint 1)no1 (true)
sms_enabledboolean (tinyint 1)no1 (true)
whatsapp_enabledboolean (tinyint 1)no1 (true)
push_enabledboolean (tinyint 1)no1 (true)
is_activeboolean (tinyint 1)no1 (true)
created_bybigint unsignedyes—FK → users.id
updated_bybigint unsignedyes—FK → users.id
created_at / updated_attimestampyes—Timestamps
deleted_attimestampyes—Soft deletes
content_pushlongtextyes—Added 2026_06_07 — per-channel template (falls back to content)
content_smslongtextyes—Added 2026_06_07
content_whatsapplongtextyes—Added 2026_06_07
content_emaillongtextyes—Added 2026_06_07
Keys / indexes
  • vendor_id → vendors.id; reminder_id → reminders.id; created_by → users.id; updated_by → users.id (default FKs)

Queue

jobs 7 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK, auto-inc)no—Primary key
queuevarchar(255)no—indexed
payloadlongtextno—
attemptstinyint unsignedno—
reserved_atint unsignedyes—
available_atint unsignedno—
created_atint unsignedno—(integer, not timestamp)
Keys / indexes
  • INDEX on `queue`

Spatie Permission Tables (teams=false)

permissions 6 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK, auto-inc)no—Primary key
namevarchar(255)no—
guard_namevarchar(255)no—
groupvarchar(255)no—
model_typeenum('admin','vendor','general')no'admin'
created_at / updated_attimestampyes—Timestamps (NO soft deletes)
Keys / indexes
  • UNIQUE `(name, guard_name)` (from create migration)
  • UNIQUE `(name, guard_name, model_type)` (added 2024_04_05_003109)

roles 12 cols

ColumnTypeNullDefaultNotes
idbigint unsigned (PK, auto-inc)no—Primary key
namevarchar(255)no—
can_edittinyintno1
is_activeenum('0','1')no1
display_namevarchar(255)yes—(this is on roles, NOT removed)
model_typeenum('admin','vendor')no'admin'
model_idbigint unsignedyes—
vendor_idbigint unsignedyes—FK → vendors.id (added 2025_08_07, after model_id)
guard_namevarchar(255)no—
created_bybigint unsignedyes—FK → users.id (added 2025_10_27)
updated_bybigint unsignedyes—FK → users.id (added 2025_10_27)
created_at / updated_attimestampyes—Timestamps (NO soft deletes)
Keys / indexes
  • vendor_id → vendors.id ON DELETE CASCADE
  • created_by → users.id ON DELETE CASCADE; updated_by → users.id ON DELETE CASCADE
  • UNIQUE `(name, vendor_id)`

model_has_permissions 3 cols

ColumnTypeNullDefaultNotes
permission_idbigint unsignedno—FK → permissions.id
model_typevarchar(255)no—morph type
model_idbigint unsignedno—morph id
Keys / indexes
  • permission_id → permissions.id ON DELETE CASCADE
  • INDEX `model_has_permissions_model_id_model_type_index` on `(model_id, model_type)`
  • PRIMARY KEY `(permission_id, model_id, model_type)`

model_has_roles 3 cols

ColumnTypeNullDefaultNotes
role_idbigint unsignedno—FK → roles.id
model_typevarchar(255)no—morph type
model_idbigint unsignedno—morph id
Keys / indexes
  • role_id → roles.id ON DELETE CASCADE
  • INDEX `model_has_roles_model_id_model_type_index` on `(model_id, model_type)`
  • PRIMARY KEY `(role_id, model_id, model_type)`

role_has_permissions 2 cols

ColumnTypeNullDefaultNotes
permission_idbigint unsignedno—FK → permissions.id
role_idbigint unsignedno—FK → roles.id
Keys / indexes
  • permission_id → permissions.id ON DELETE CASCADE
  • role_id → roles.id ON DELETE CASCADE
  • PRIMARY KEY `(permission_id, role_id)`