CREATE TABLE `_bak_appointment_occurrences_20260211_155205` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `appointment_id` bigint(20) unsigned NOT NULL,
  `starts_at` datetime NOT NULL,
  `ends_at` datetime NOT NULL,
  `status_id` bigint(20) unsigned DEFAULT NULL,
  `is_cancelled` tinyint(1) NOT NULL DEFAULT 0,
  `notes` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `appointment_occurrences_status_id_foreign` (`status_id`),
  KEY `appointment_occurrences_starts_at_index` (`starts_at`),
  KEY `appointment_occurrences_ends_at_index` (`ends_at`),
  KEY `appointment_occurrences_starts_at_ends_at_index` (`starts_at`,`ends_at`),
  KEY `appointment_occurrences_appointment_id_starts_at_index` (`appointment_id`,`starts_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `_bak_appointment_occurrences_20260211_160010` (
  `id` bigint(20) unsigned NOT NULL DEFAULT 0,
  `appointment_id` bigint(20) unsigned NOT NULL,
  `starts_at` datetime NOT NULL,
  `ends_at` datetime NOT NULL,
  `status_id` bigint(20) unsigned DEFAULT NULL,
  `is_cancelled` tinyint(1) NOT NULL DEFAULT 0,
  `notes` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `_bak_appointment_occurrences_20260211_161159` (
  `id` bigint(20) unsigned NOT NULL DEFAULT 0,
  `appointment_id` bigint(20) unsigned NOT NULL,
  `starts_at` datetime NOT NULL,
  `ends_at` datetime NOT NULL,
  `status_id` bigint(20) unsigned DEFAULT NULL,
  `is_cancelled` tinyint(1) NOT NULL DEFAULT 0,
  `notes` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `_bak_appointment_occurrences_20260211_162518` (
  `id` bigint(20) unsigned NOT NULL DEFAULT 0,
  `appointment_id` bigint(20) unsigned NOT NULL,
  `starts_at` datetime NOT NULL,
  `ends_at` datetime NOT NULL,
  `status_id` bigint(20) unsigned DEFAULT NULL,
  `is_cancelled` tinyint(1) NOT NULL DEFAULT 0,
  `notes` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `_bak_appointments_20260211_155205` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `account_id` bigint(20) unsigned NOT NULL,
  `primary_contact_id` bigint(20) unsigned DEFAULT NULL,
  `service_id` bigint(20) unsigned DEFAULT NULL,
  `status_id` bigint(20) unsigned NOT NULL,
  `title` varchar(250) NOT NULL,
  `description_html` longtext DEFAULT NULL,
  `location_text` varchar(255) DEFAULT NULL,
  `all_day` tinyint(1) NOT NULL DEFAULT 0,
  `timezone` varchar(64) NOT NULL DEFAULT 'America/Vancouver',
  `color` varchar(32) DEFAULT NULL,
  `created_by_user_id` bigint(20) unsigned DEFAULT NULL,
  `assigned_to_user_id` bigint(20) unsigned DEFAULT NULL,
  `is_recurring` tinyint(1) NOT NULL DEFAULT 0,
  `rrule` text DEFAULT NULL,
  `recurrence_until` datetime DEFAULT NULL,
  `recurrence_count` int(11) DEFAULT NULL,
  `exdates` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`exdates`)),
  `source` varchar(40) DEFAULT NULL,
  `external_uid` varchar(191) DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `appointments_created_by_user_id_foreign` (`created_by_user_id`),
  KEY `appointments_external_uid_index` (`external_uid`),
  KEY `appointments_service_id_index` (`service_id`),
  KEY `appointments_status_id_index` (`status_id`),
  KEY `appointments_assigned_to_user_id_index` (`assigned_to_user_id`),
  KEY `appointments_account_id_index` (`account_id`),
  KEY `appointments_primary_contact_id_index` (`primary_contact_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `_bak_appointments_20260211_160010` (
  `id` bigint(20) unsigned NOT NULL DEFAULT 0,
  `account_id` bigint(20) unsigned NOT NULL,
  `primary_contact_id` bigint(20) unsigned DEFAULT NULL,
  `service_id` bigint(20) unsigned DEFAULT NULL,
  `status_id` bigint(20) unsigned NOT NULL,
  `title` varchar(250) NOT NULL,
  `description_html` longtext DEFAULT NULL,
  `location_text` varchar(255) DEFAULT NULL,
  `all_day` tinyint(1) NOT NULL DEFAULT 0,
  `timezone` varchar(64) NOT NULL DEFAULT 'America/Vancouver',
  `color` varchar(32) DEFAULT NULL,
  `created_by_user_id` bigint(20) unsigned DEFAULT NULL,
  `assigned_to_user_id` bigint(20) unsigned DEFAULT NULL,
  `is_recurring` tinyint(1) NOT NULL DEFAULT 0,
  `rrule` text DEFAULT NULL,
  `recurrence_until` datetime DEFAULT NULL,
  `recurrence_count` int(11) DEFAULT NULL,
  `exdates` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `source` varchar(40) DEFAULT NULL,
  `external_uid` varchar(191) DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `_bak_appointments_20260211_161159` (
  `id` bigint(20) unsigned NOT NULL DEFAULT 0,
  `account_id` bigint(20) unsigned NOT NULL,
  `primary_contact_id` bigint(20) unsigned DEFAULT NULL,
  `service_id` bigint(20) unsigned DEFAULT NULL,
  `status_id` bigint(20) unsigned NOT NULL,
  `title` varchar(250) NOT NULL,
  `description_html` longtext DEFAULT NULL,
  `location_text` varchar(255) DEFAULT NULL,
  `all_day` tinyint(1) NOT NULL DEFAULT 0,
  `timezone` varchar(64) NOT NULL DEFAULT 'America/Vancouver',
  `color` varchar(32) DEFAULT NULL,
  `created_by_user_id` bigint(20) unsigned DEFAULT NULL,
  `assigned_to_user_id` bigint(20) unsigned DEFAULT NULL,
  `is_recurring` tinyint(1) NOT NULL DEFAULT 0,
  `rrule` text DEFAULT NULL,
  `recurrence_until` datetime DEFAULT NULL,
  `recurrence_count` int(11) DEFAULT NULL,
  `exdates` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `source` varchar(40) DEFAULT NULL,
  `external_uid` varchar(191) DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `_bak_appointments_20260211_162518` (
  `id` bigint(20) unsigned NOT NULL DEFAULT 0,
  `account_id` bigint(20) unsigned NOT NULL,
  `primary_contact_id` bigint(20) unsigned DEFAULT NULL,
  `service_id` bigint(20) unsigned DEFAULT NULL,
  `status_id` bigint(20) unsigned NOT NULL,
  `title` varchar(250) NOT NULL,
  `description_html` longtext DEFAULT NULL,
  `location_text` varchar(255) DEFAULT NULL,
  `all_day` tinyint(1) NOT NULL DEFAULT 0,
  `timezone` varchar(64) NOT NULL DEFAULT 'America/Vancouver',
  `color` varchar(32) DEFAULT NULL,
  `created_by_user_id` bigint(20) unsigned DEFAULT NULL,
  `assigned_to_user_id` bigint(20) unsigned DEFAULT NULL,
  `is_recurring` tinyint(1) NOT NULL DEFAULT 0,
  `rrule` text DEFAULT NULL,
  `recurrence_until` datetime DEFAULT NULL,
  `recurrence_count` int(11) DEFAULT NULL,
  `exdates` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `source` varchar(40) DEFAULT NULL,
  `external_uid` varchar(191) DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `account_addresses` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `account_id` bigint(20) unsigned DEFAULT NULL,
  `label` varchar(255) DEFAULT NULL,
  `line_1` varchar(255) DEFAULT NULL,
  `line_2` varchar(255) DEFAULT NULL,
  `city` varchar(255) DEFAULT NULL,
  `state` varchar(255) DEFAULT NULL,
  `zip` varchar(255) DEFAULT NULL,
  `country` varchar(255) DEFAULT NULL,
  `is_primary` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `account_contact` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `account_id` bigint(20) unsigned NOT NULL,
  `contact_id` bigint(20) unsigned NOT NULL,
  `is_primary` tinyint(1) NOT NULL DEFAULT 0,
  `is_emergency` tinyint(1) NOT NULL DEFAULT 0,
  `source` varchar(20) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `account_contact_account_id_contact_id_unique` (`account_id`,`contact_id`),
  KEY `account_contact_contact_id_foreign` (`contact_id`),
  KEY `account_contact_account_id_is_primary_index` (`account_id`,`is_primary`),
  KEY `account_contact_account_id_is_emergency_index` (`account_id`,`is_emergency`),
  CONSTRAINT `account_contact_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
  CONSTRAINT `account_contact_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `account_document` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `account_id` bigint(20) unsigned NOT NULL,
  `document_id` bigint(20) unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `account_document_unique` (`account_id`,`document_id`),
  KEY `account_document_account_id_index` (`account_id`),
  KEY `account_document_document_id_index` (`document_id`),
  CONSTRAINT `account_document_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
  CONSTRAINT `account_document_document_id_foreign` FOREIGN KEY (`document_id`) REFERENCES `documents` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `account_hour_periods` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `account_hours_id` bigint(20) unsigned NOT NULL,
  `day_of_week` tinyint(3) unsigned NOT NULL,
  `start_time` time DEFAULT NULL,
  `end_time` time DEFAULT NULL,
  `is_closed` tinyint(1) NOT NULL DEFAULT 0,
  `spans_midnight` tinyint(1) NOT NULL DEFAULT 0,
  `sort_order` smallint(5) unsigned NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `account_hour_periods_account_hours_id_day_of_week_index` (`account_hours_id`,`day_of_week`),
  CONSTRAINT `account_hour_periods_account_hours_id_foreign` FOREIGN KEY (`account_hours_id`) REFERENCES `account_hours` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `account_hours` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `account_id` bigint(20) unsigned NOT NULL,
  `same_hours` tinyint(1) NOT NULL DEFAULT 0,
  `timezone` varchar(64) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `account_hours_account_id_unique` (`account_id`),
  CONSTRAINT `account_hours_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `account_phones` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `account_id` bigint(20) unsigned NOT NULL,
  `label` varchar(100) DEFAULT NULL,
  `number` varchar(100) DEFAULT NULL,
  `ext` varchar(20) DEFAULT NULL,
  `is_primary` tinyint(1) DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `account_id` (`account_id`),
  CONSTRAINT `account_phones_ibfk_1` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `account_phones_backup_2026_01_29` (
  `id` bigint(20) unsigned NOT NULL DEFAULT 0,
  `account_id` bigint(20) unsigned NOT NULL,
  `label` varchar(100) DEFAULT NULL,
  `number` varchar(100) DEFAULT NULL,
  `is_primary` tinyint(1) DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `account_social_links` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `account_id` bigint(20) unsigned NOT NULL,
  `platform` varchar(50) NOT NULL,
  `url` varchar(500) NOT NULL,
  `label` varchar(100) DEFAULT NULL,
  `sort_order` smallint(5) unsigned NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `account_social_links_account_id_platform_unique` (`account_id`,`platform`),
  KEY `account_social_links_account_id_sort_order_index` (`account_id`,`sort_order`),
  CONSTRAINT `account_social_links_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `accounts` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `legacy_id` bigint(20) unsigned DEFAULT NULL,
  `company_name` varchar(255) DEFAULT NULL,
  `legal_business_name` varchar(255) DEFAULT NULL,
  `suffix` varchar(80) DEFAULT NULL,
  `status` varchar(50) DEFAULT NULL,
  `region` varchar(80) DEFAULT NULL,
  `industry` varchar(120) DEFAULT NULL,
  `type` varchar(50) DEFAULT NULL,
  `lead_status` varchar(20) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `created_by_contact_id` bigint(20) unsigned DEFAULT NULL,
  `created_by_name` varchar(255) DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `updated_by_contact_id` bigint(20) unsigned DEFAULT NULL,
  `updated_by_name` varchar(255) DEFAULT NULL,
  `account_manager_id` bigint(20) unsigned DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `timezone` varchar(30) DEFAULT 'America/Vancouver',
  `preferred_payment` varchar(20) DEFAULT NULL,
  `payment_terms` varchar(20) DEFAULT NULL,
  `license_rsn` varchar(255) DEFAULT NULL,
  `website` varchar(500) DEFAULT NULL,
  `keywords` varchar(250) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `accounts_legacy_id_unique` (`legacy_id`),
  KEY `accounts_legacy_id_index` (`legacy_id`),
  KEY `idx_accounts_created_by_contact_id` (`created_by_contact_id`),
  KEY `idx_accounts_updated_by_contact_id` (`updated_by_contact_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `accounts_suffix_import` (
  `legacy_id` bigint(20) unsigned NOT NULL,
  `suffix` varchar(255) NOT NULL,
  PRIMARY KEY (`legacy_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
CREATE TABLE `address_types` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `legacy_id` bigint(20) unsigned DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `description` varchar(250) DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uniq_address_types_name` (`name`),
  KEY `idx_address_types_legacy_id` (`legacy_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
CREATE TABLE `appointment_attendees` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `appointment_id` bigint(20) unsigned NOT NULL,
  `contact_id` bigint(20) unsigned DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `role` varchar(30) DEFAULT NULL,
  `response_status` varchar(20) DEFAULT NULL,
  `is_required` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_appt_contact` (`appointment_id`,`contact_id`),
  UNIQUE KEY `uq_appt_user` (`appointment_id`,`user_id`),
  KEY `appointment_attendees_appointment_id_index` (`appointment_id`),
  KEY `appointment_attendees_contact_id_index` (`contact_id`),
  KEY `appointment_attendees_user_id_index` (`user_id`),
  CONSTRAINT `appointment_attendees_appointment_id_foreign` FOREIGN KEY (`appointment_id`) REFERENCES `appointments` (`id`) ON DELETE CASCADE,
  CONSTRAINT `appointment_attendees_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE,
  CONSTRAINT `appointment_attendees_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `appointment_occurrences` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `appointment_id` bigint(20) unsigned NOT NULL,
  `starts_at` datetime NOT NULL,
  `ends_at` datetime NOT NULL,
  `status_id` bigint(20) unsigned DEFAULT NULL,
  `is_cancelled` tinyint(1) NOT NULL DEFAULT 0,
  `notes` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `appointment_occurrences_status_id_foreign` (`status_id`),
  KEY `appointment_occurrences_starts_at_index` (`starts_at`),
  KEY `appointment_occurrences_ends_at_index` (`ends_at`),
  KEY `appointment_occurrences_starts_at_ends_at_index` (`starts_at`,`ends_at`),
  KEY `appointment_occurrences_appointment_id_starts_at_index` (`appointment_id`,`starts_at`),
  CONSTRAINT `appointment_occurrences_appointment_id_foreign` FOREIGN KEY (`appointment_id`) REFERENCES `appointments` (`id`) ON DELETE CASCADE,
  CONSTRAINT `appointment_occurrences_status_id_foreign` FOREIGN KEY (`status_id`) REFERENCES `appointment_statuses` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `appointment_reminder_logs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `appointment_occurrence_id` bigint(20) unsigned NOT NULL,
  `appointment_reminder_id` bigint(20) unsigned NOT NULL,
  `channel` varchar(20) NOT NULL,
  `sent_to` varchar(255) DEFAULT NULL,
  `sent_at` datetime DEFAULT NULL,
  `status` varchar(20) NOT NULL DEFAULT 'queued',
  `provider_message_id` varchar(191) DEFAULT NULL,
  `error` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `appointment_reminder_logs_appointment_occurrence_id_index` (`appointment_occurrence_id`),
  KEY `appointment_reminder_logs_appointment_reminder_id_index` (`appointment_reminder_id`),
  KEY `appointment_reminder_logs_status_sent_at_index` (`status`,`sent_at`),
  CONSTRAINT `appointment_reminder_logs_appointment_occurrence_id_foreign` FOREIGN KEY (`appointment_occurrence_id`) REFERENCES `appointment_occurrences` (`id`) ON DELETE CASCADE,
  CONSTRAINT `appointment_reminder_logs_appointment_reminder_id_foreign` FOREIGN KEY (`appointment_reminder_id`) REFERENCES `appointment_reminders` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `appointment_reminders` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `appointment_id` bigint(20) unsigned NOT NULL,
  `channel` varchar(20) NOT NULL,
  `minutes_before` int(11) NOT NULL,
  `target` varchar(20) NOT NULL DEFAULT 'attendees',
  `is_enabled` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `appointment_reminders_appointment_id_index` (`appointment_id`),
  KEY `appointment_reminders_channel_minutes_before_index` (`channel`,`minutes_before`),
  CONSTRAINT `appointment_reminders_appointment_id_foreign` FOREIGN KEY (`appointment_id`) REFERENCES `appointments` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `appointments` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `account_id` bigint(20) unsigned NOT NULL,
  `primary_contact_id` bigint(20) unsigned DEFAULT NULL,
  `service_id` bigint(20) unsigned DEFAULT NULL,
  `status_id` bigint(20) unsigned NOT NULL,
  `title` varchar(250) NOT NULL,
  `description_html` longtext DEFAULT NULL,
  `location_text` varchar(255) DEFAULT NULL,
  `all_day` tinyint(1) NOT NULL DEFAULT 0,
  `timezone` varchar(64) NOT NULL DEFAULT 'America/Vancouver',
  `color` varchar(32) DEFAULT NULL,
  `created_by_user_id` bigint(20) unsigned DEFAULT NULL,
  `assigned_to_user_id` bigint(20) unsigned DEFAULT NULL,
  `is_recurring` tinyint(1) NOT NULL DEFAULT 0,
  `rrule` text DEFAULT NULL,
  `recurrence_until` datetime DEFAULT NULL,
  `recurrence_count` int(11) DEFAULT NULL,
  `exdates` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`exdates`)),
  `source` varchar(40) DEFAULT NULL,
  `external_uid` varchar(191) DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `appointments_created_by_user_id_foreign` (`created_by_user_id`),
  KEY `appointments_external_uid_index` (`external_uid`),
  KEY `appointments_service_id_index` (`service_id`),
  KEY `appointments_status_id_index` (`status_id`),
  KEY `appointments_assigned_to_user_id_index` (`assigned_to_user_id`),
  KEY `appointments_account_id_index` (`account_id`),
  KEY `appointments_primary_contact_id_index` (`primary_contact_id`),
  CONSTRAINT `appointments_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
  CONSTRAINT `appointments_assigned_to_user_id_foreign` FOREIGN KEY (`assigned_to_user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `appointments_created_by_user_id_foreign` FOREIGN KEY (`created_by_user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `appointments_primary_contact_id_foreign` FOREIGN KEY (`primary_contact_id`) REFERENCES `contacts` (`id`) ON DELETE SET NULL,
  CONSTRAINT `appointments_service_id_foreign` FOREIGN KEY (`service_id`) REFERENCES `appointment_services` (`id`) ON DELETE SET NULL,
  CONSTRAINT `appointments_status_id_foreign` FOREIGN KEY (`status_id`) REFERENCES `appointment_statuses` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `contact_addresses` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `contact_id` bigint(20) unsigned NOT NULL,
  `label` varchar(255) DEFAULT NULL,
  `line_1` varchar(255) DEFAULT NULL,
  `line_2` varchar(255) DEFAULT NULL,
  `city` varchar(255) DEFAULT NULL,
  `state` varchar(255) DEFAULT NULL,
  `zip` varchar(255) DEFAULT NULL,
  `country` varchar(255) DEFAULT NULL,
  `is_primary` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `contact_addresses_contact_id_index` (`contact_id`),
  CONSTRAINT `contact_addresses_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `contact_document` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `contact_id` bigint(20) unsigned NOT NULL,
  `document_id` bigint(20) unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `contact_document_unique` (`contact_id`,`document_id`),
  KEY `contact_document_contact_id_index` (`contact_id`),
  KEY `contact_document_document_id_index` (`document_id`),
  CONSTRAINT `contact_document_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE,
  CONSTRAINT `contact_document_document_id_foreign` FOREIGN KEY (`document_id`) REFERENCES `documents` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `contact_phones` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `contact_id` bigint(20) unsigned NOT NULL,
  `label` varchar(100) DEFAULT NULL,
  `number` varchar(100) DEFAULT NULL,
  `ext` varchar(20) DEFAULT NULL,
  `is_primary` tinyint(1) DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `contact_id` (`contact_id`),
  CONSTRAINT `contact_phones_ibfk_1` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `documents` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `category` varchar(50) DEFAULT NULL,
  `owner_user_id` bigint(20) unsigned DEFAULT NULL,
  `legacy_owner_user_id` bigint(20) unsigned DEFAULT NULL,
  `source` varchar(50) NOT NULL DEFAULT 'legacy_gd_documents',
  `legacy_table` varchar(64) DEFAULT NULL,
  `legacy_id` bigint(20) unsigned DEFAULT NULL,
  `legacy_local_filename` varchar(255) DEFAULT NULL,
  `legacy_real_filename` varchar(255) DEFAULT NULL,
  `account_id` bigint(20) unsigned DEFAULT NULL,
  `legacy_account_id` bigint(20) unsigned DEFAULT NULL,
  `uploaded_at` datetime DEFAULT NULL,
  `missing_file` tinyint(1) NOT NULL DEFAULT 0,
  `media_id` bigint(20) unsigned DEFAULT NULL,
  `mime` varchar(255) DEFAULT NULL,
  `size` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `documents_legacy_unique` (`legacy_table`,`legacy_id`),
  KEY `documents_account_id_uploaded_at_index` (`account_id`,`uploaded_at`),
  KEY `documents_media_id_index` (`media_id`),
  KEY `documents_source_index` (`source`),
  KEY `documents_owner_user_id_foreign` (`owner_user_id`),
  KEY `documents_legacy_owner_user_id_index` (`legacy_owner_user_id`),
  KEY `documents_legacy_account_id_index` (`legacy_account_id`),
  CONSTRAINT `documents_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE SET NULL,
  CONSTRAINT `documents_media_id_foreign` FOREIGN KEY (`media_id`) REFERENCES `media` (`id`) ON DELETE SET NULL,
  CONSTRAINT `documents_owner_user_id_foreign` FOREIGN KEY (`owner_user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `how_heard_options` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(120) NOT NULL,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `how_heard_options_name_unique` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `media` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `model_type` varchar(255) NOT NULL,
  `uuid` char(36) DEFAULT NULL,
  `model_id` bigint(20) unsigned NOT NULL,
  `collection_name` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `file_name` varchar(255) NOT NULL,
  `mime_type` varchar(255) DEFAULT NULL,
  `disk` varchar(255) NOT NULL,
  `conversions_disk` varchar(255) DEFAULT NULL,
  `size` bigint(20) unsigned NOT NULL,
  `manipulations` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`manipulations`)),
  `custom_properties` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`custom_properties`)),
  `generated_conversions` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`generated_conversions`)),
  `responsive_images` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`responsive_images`)),
  `order_column` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_media_model` (`model_type`,`model_id`),
  KEY `idx_media_collection` (`collection_name`),
  KEY `media_uuid_index` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `migrations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) NOT NULL,
  `batch` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `notes` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(255) DEFAULT NULL,
  `body` longtext DEFAULT NULL,
  `account_id` bigint(20) unsigned DEFAULT NULL,
  `contact_id` bigint(20) unsigned DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `type` varchar(50) DEFAULT NULL,
  `status` varchar(50) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `search_key` text DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `notes_account_id_index` (`account_id`),
  KEY `notes_contact_id_index` (`contact_id`),
  KEY `notes_user_id_index` (`user_id`),
  KEY `notes_search_key_index` (`search_key`(191))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `phone_numbers` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `contact_id` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `label` varchar(255) DEFAULT NULL,
  `number` varchar(255) NOT NULL,
  `extension` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `phone_numbers_contact_id_foreign` (`contact_id`),
  CONSTRAINT `phone_numbers_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `regions` (
  `id` int(11) NOT NULL,
  `name` varchar(25) DEFAULT NULL,
  `description` varchar(250) DEFAULT NULL,
  `sort_order` tinyint(4) DEFAULT 0,
  `state` varchar(2) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
CREATE TABLE `services` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `todos` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `legacy_id` bigint(20) unsigned DEFAULT NULL,
  `title` varchar(255) NOT NULL,
  `notes` text DEFAULT NULL,
  `status` varchar(50) DEFAULT NULL,
  `priority` varchar(50) DEFAULT NULL,
  `due_at` datetime DEFAULT NULL,
  `completed_at` datetime DEFAULT NULL,
  `archived_at` datetime DEFAULT NULL,
  `show_on_calendar` tinyint(1) NOT NULL DEFAULT 0,
  `remind_at` timestamp NULL DEFAULT NULL,
  `reminder_sent` tinyint(1) NOT NULL DEFAULT 0,
  `reminder_at` datetime DEFAULT NULL,
  `account_id` bigint(20) unsigned DEFAULT NULL,
  `contact_id` bigint(20) unsigned DEFAULT NULL,
  `assigned_user_id` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `created_by` bigint(20) unsigned DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` datetime DEFAULT NULL,
  `reminder_delivered_at` datetime DEFAULT NULL,
  `reminder_seen_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `todos_account_id_index` (`account_id`),
  KEY `todos_contact_id_index` (`contact_id`),
  KEY `todos_assigned_user_id_index` (`assigned_user_id`),
  KEY `todos_reminder_delivered_at_index` (`reminder_delivered_at`),
  KEY `todos_reminder_seen_at_index` (`reminder_seen_at`),
  KEY `idx_todos_deleted_at` (`deleted_at`),
  KEY `idx_todos_created_by` (`created_by`),
  KEY `idx_todos_archived_at` (`archived_at`),
  KEY `idx_todos_legacy_id` (`legacy_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `todos_import_staging` (
  `id` bigint(20) unsigned NOT NULL DEFAULT 0,
  `title` varchar(240) NOT NULL,
  `notes` longtext DEFAULT NULL,
  `status` enum('todo','in_progress','done','cancelled') NOT NULL DEFAULT 'todo',
  `priority` enum('low','normal','high','urgent') NOT NULL DEFAULT 'normal',
  `due_at` datetime DEFAULT NULL,
  `assigned_user_id` bigint(20) unsigned DEFAULT NULL,
  `account_id` bigint(20) unsigned DEFAULT NULL,
  `contact_id` bigint(20) unsigned DEFAULT NULL,
  `service_id` bigint(20) unsigned DEFAULT NULL,
  `related_appointment_id` bigint(20) unsigned DEFAULT NULL,
  `created_by` bigint(20) unsigned NOT NULL,
  `completed_at` datetime DEFAULT NULL,
  `reminder_at` datetime DEFAULT NULL,
  `show_on_calendar` tinyint(1) NOT NULL DEFAULT 0,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `reminder_delivered_at` datetime DEFAULT NULL,
  `reminder_seen_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `users_and_password_reset_tokens_tables` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (1,'2025_12_21_000000_create_todos_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (2,'2025_12_21_000001_add_todo_reminder_delivery_columns',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (3,'2025_12_21_102836_add_reminders_to_todos_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (4,'2026_01_09_000000_create_notes_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (5,'2026_01_09_142139_add_search_key_to_notes_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (6,'2026_01_09_143630_alter_notes_search_key_to_text',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (7,'2026_01_12_000000_create_service_reports_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (8,'2026_01_12_000002_add_token_to_service_reports',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (9,'2026_01_12_121313_add_template_key_to_service_reports_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (10,'2026_01_21_000000_create_accounts_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (11,'2026_01_21_000000_create_contacts_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (12,'2026_01_21_000001_create_account_contact_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (13,'2026_01_21_134051_add_unique_account_contact_pair',2);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (14,'2026_01_22_120352_add_remember_token_to_contacts_table',3);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (15,'2026_01_22_124354_create_users_and_password_reset_tokens_tables',4);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (17,'2026_01_22_174747_create_phone_numbers_table',5);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (18,'2026_01_22_182941_alter_phone_numbers_add_fields',6);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (19,'2026_01_23_000000_alter_phone_numbers_add_fields_v2',7);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (21,'2026_01_23_142102_create_contact_addresses_table',8);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (22,'2026_01_28_093200_create_documents_table',9);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (23,'2026_01_28_093210_create_account_document_table',9);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (24,'2026_01_28_093220_create_contact_document_table',9);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (25,'2026_01_28_095055_add_legacy_owner_user_id_to_documents_table',10);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (26,'2026_01_28_095608_upgrade_media_table_for_spatie',11);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (27,'2026_01_28_100115_add_legacy_account_id_to_documents_table',12);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (28,'2026_01_29_233644_create_account_hours_tables',13);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (29,'2026_01_29_233644_create_account_social_links_table',13);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (30,'2026_02_06_063216_add_ext_to_contact_phones_table',14);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (31,'2026_02_06_065440_make_contact_addresses_contact_id_not_null',15);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (32,'2026_02_06_070312_add_position_to_contacts_table',16);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (33,'2026_02_06_075528_add_audit_fields_to_contacts_table',17);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (34,'2026_02_06_083337_add_modified_by_name_to_contacts_table',18);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (35,'2026_02_10_163455_2026_02_10_000001_add_is_staff_to_users_table',19);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (36,'2026_02_10_163455_2026_02_10_000010_create_appointment_statuses_table',19);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (37,'2026_02_10_163456_2026_02_10_000020_create_appointment_services_table',19);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (38,'2026_02_10_163456_2026_02_10_000030_create_appointments_table',19);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (39,'2026_02_10_163456_2026_02_10_000040_create_appointment_occurrences_table',19);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (40,'2026_02_10_163456_2026_02_10_000050_create_appointment_attendees_table',19);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (41,'2026_02_10_163456_2026_02_10_000060_create_appointment_reminders_table',19);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (42,'2026_02_10_163457_2026_02_10_000070_create_appointment_reminder_logs_table',19);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (43,'2026_02_13_050307_create_services_table',20);
