ok
Direktori : /home2/selectio/public_html/fms-worksuite/database/schema/ |
Current File : /home2/selectio/public_html/fms-worksuite/database/schema/mysql-schema.dump |
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `accept_estimates`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `accept_estimates` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `estimate_id` int unsigned NOT NULL, `full_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `signature` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `accept_estimates_company_id_foreign` (`company_id`), KEY `accept_estimates_estimate_id_foreign` (`estimate_id`), CONSTRAINT `accept_estimates_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `accept_estimates_estimate_id_foreign` FOREIGN KEY (`estimate_id`) REFERENCES `estimates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `attendance_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `attendance_settings` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `auto_clock_in` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `office_start_time` time NOT NULL, `office_end_time` time NOT NULL, `halfday_mark_time` time DEFAULT NULL, `late_mark_duration` tinyint NOT NULL, `clockin_in_day` int NOT NULL DEFAULT '1', `employee_clock_in_out` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'yes', `office_open_days` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '[1,2,3,4,5]', `ip_address` text COLLATE utf8mb4_unicode_ci, `radius` int DEFAULT NULL, `radius_check` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `ip_check` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `alert_after` int DEFAULT NULL, `alert_after_status` tinyint(1) NOT NULL DEFAULT '1', `save_current_location` tinyint(1) NOT NULL DEFAULT '0', `default_employee_shift` bigint unsigned DEFAULT '1', `week_start_from` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '1', `allow_shift_change` tinyint(1) NOT NULL DEFAULT '1', `show_clock_in_button` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `attendance_settings_company_id_foreign` (`company_id`), KEY `attendance_settings_default_employee_shift_foreign` (`default_employee_shift`), CONSTRAINT `attendance_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `attendance_settings_default_employee_shift_foreign` FOREIGN KEY (`default_employee_shift`) REFERENCES `employee_shifts` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `attendances`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `attendances` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `location_id` bigint unsigned DEFAULT NULL, `clock_in_time` datetime NOT NULL, `clock_out_time` datetime DEFAULT NULL, `clock_in_ip` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `clock_out_ip` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `working_from` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'office', `late` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `half_day` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `latitude` decimal(10,8) DEFAULT NULL, `longitude` decimal(11,8) DEFAULT NULL, `shift_start_time` datetime DEFAULT NULL, `shift_end_time` datetime DEFAULT NULL, `employee_shift_id` bigint unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `attendances_company_id_foreign` (`company_id`), KEY `attendances_user_id_foreign` (`user_id`), KEY `attendances_location_id_foreign` (`location_id`), KEY `attendances_clock_in_time_index` (`clock_in_time`), KEY `attendances_clock_out_time_index` (`clock_out_time`), KEY `attendances_added_by_foreign` (`added_by`), KEY `attendances_last_updated_by_foreign` (`last_updated_by`), KEY `attendances_employee_shift_id_foreign` (`employee_shift_id`), CONSTRAINT `attendances_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `attendances_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `attendances_employee_shift_id_foreign` FOREIGN KEY (`employee_shift_id`) REFERENCES `employee_shifts` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `attendances_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `attendances_location_id_foreign` FOREIGN KEY (`location_id`) REFERENCES `company_addresses` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `attendances_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `client_categories`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `client_categories` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `category_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `client_categories_company_id_foreign` (`company_id`), CONSTRAINT `client_categories_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `client_contacts`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `client_contacts` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `contact_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `phone` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `title` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `client_contacts_company_id_foreign` (`company_id`), KEY `client_contacts_user_id_foreign` (`user_id`), KEY `client_contacts_added_by_foreign` (`added_by`), KEY `client_contacts_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `client_contacts_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `client_contacts_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `client_contacts_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `client_contacts_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `client_details`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `client_details` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `company_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `address` text COLLATE utf8mb4_unicode_ci, `shipping_address` text COLLATE utf8mb4_unicode_ci, `postal_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `state` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `city` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `office` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `website` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `note` text COLLATE utf8mb4_unicode_ci, `linkedin` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `facebook` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `twitter` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `skype` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `gst_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `category_id` bigint unsigned DEFAULT NULL, `sub_category_id` bigint unsigned DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `client_details_company_id_foreign` (`company_id`), KEY `client_details_user_id_foreign` (`user_id`), KEY `client_details_category_id_foreign` (`category_id`), KEY `client_details_sub_category_id_foreign` (`sub_category_id`), KEY `client_details_added_by_foreign` (`added_by`), KEY `client_details_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `client_details_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `client_details_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `client_categories` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `client_details_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `client_details_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `client_details_sub_category_id_foreign` FOREIGN KEY (`sub_category_id`) REFERENCES `client_sub_categories` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `client_details_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `client_docs`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `client_docs` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL, `filename` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL, `hashname` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL, `size` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `client_docs_company_id_foreign` (`company_id`), KEY `client_docs_user_id_foreign` (`user_id`), KEY `client_docs_added_by_foreign` (`added_by`), KEY `client_docs_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `client_docs_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `client_docs_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `client_docs_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `client_docs_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `client_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `client_notes` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `client_id` int unsigned DEFAULT NULL, `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `type` tinyint(1) NOT NULL DEFAULT '0', `member_id` int unsigned DEFAULT NULL, `is_client_show` tinyint(1) NOT NULL DEFAULT '0', `ask_password` tinyint(1) NOT NULL DEFAULT '0', `details` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `client_notes_company_id_foreign` (`company_id`), KEY `client_notes_client_id_foreign` (`client_id`), KEY `client_notes_member_id_foreign` (`member_id`), KEY `client_notes_added_by_foreign` (`added_by`), KEY `client_notes_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `client_notes_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `client_notes_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `client_notes_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `client_notes_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `client_notes_member_id_foreign` FOREIGN KEY (`member_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `client_sub_categories`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `client_sub_categories` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `category_id` bigint unsigned NOT NULL, `category_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `client_sub_categories_company_id_foreign` (`company_id`), KEY `client_sub_categories_category_id_foreign` (`category_id`), CONSTRAINT `client_sub_categories_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `client_categories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `client_sub_categories_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `client_user_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `client_user_notes` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `client_note_id` int unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `client_user_notes_company_id_foreign` (`company_id`), KEY `client_user_notes_user_id_foreign` (`user_id`), KEY `client_user_notes_client_note_id_foreign` (`client_note_id`), CONSTRAINT `client_user_notes_client_note_id_foreign` FOREIGN KEY (`client_note_id`) REFERENCES `client_notes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `client_user_notes_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `client_user_notes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `companies`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `companies` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `app_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `company_email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `company_phone` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `logo` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `login_background` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `address` text COLLATE utf8mb4_unicode_ci NOT NULL, `website` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `currency_id` int unsigned DEFAULT NULL, `timezone` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Asia/Kolkata', `date_format` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'd-m-Y', `date_picker_format` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'dd-mm-yyyy', `moment_format` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'DD-MM-YYYY', `time_format` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'h:i a', `locale` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'en', `latitude` decimal(10,8) NOT NULL DEFAULT '26.91243360', `longitude` decimal(11,8) NOT NULL DEFAULT '75.78727090', `leaves_start_from` enum('joining_date','year_start') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'joining_date', `active_theme` enum('default','custom') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'default', `last_updated_by` int unsigned DEFAULT NULL, `currency_converter_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `google_map_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `task_self` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'yes', `purchase_code` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `license_type` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `supported_until` timestamp NULL DEFAULT NULL, `google_recaptcha_status` enum('active','deactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'deactive', `google_recaptcha_v2_status` enum('active','deactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'deactive', `google_recaptcha_v2_site_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `google_recaptcha_v2_secret_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `google_recaptcha_v3_status` enum('active','deactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'deactive', `google_recaptcha_v3_site_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `google_recaptcha_v3_secret_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `app_debug` tinyint(1) NOT NULL DEFAULT '0', `rounded_theme` tinyint(1) NOT NULL DEFAULT '1', `hide_cron_message` tinyint(1) NOT NULL DEFAULT '0', `system_update` tinyint(1) NOT NULL DEFAULT '1', `logo_background_color` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#ffffff', `before_days` int NOT NULL, `after_days` int NOT NULL, `on_deadline` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'yes', `default_task_status` int unsigned NOT NULL DEFAULT '1', `show_review_modal` tinyint(1) NOT NULL DEFAULT '1', `dashboard_clock` tinyint(1) NOT NULL DEFAULT '1', `ticket_form_google_captcha` tinyint(1) NOT NULL DEFAULT '0', `lead_form_google_captcha` tinyint(1) NOT NULL DEFAULT '0', `taskboard_length` int NOT NULL DEFAULT '10', `last_cron_run` timestamp NULL DEFAULT NULL, `favicon` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `auth_theme` enum('dark','light') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'light', `light_logo` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `sidebar_logo_style` enum('square','full') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'square', `session_driver` enum('file','database') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'file', `allow_client_signup` tinyint(1) NOT NULL, `admin_client_signup_approval` tinyint(1) NOT NULL, `allowed_file_types` text COLLATE utf8mb4_unicode_ci, `google_calendar_status` enum('active','inactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'inactive', `google_client_id` text COLLATE utf8mb4_unicode_ci, `google_client_secret` text COLLATE utf8mb4_unicode_ci, `google_calendar_verification_status` enum('verified','non_verified') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'non_verified', `google_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `token` text COLLATE utf8mb4_unicode_ci, `allowed_file_size` int NOT NULL DEFAULT '10', `currency_key_version` enum('free','api') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'free', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `companies_currency_id_foreign` (`currency_id`), KEY `companies_last_updated_by_foreign` (`last_updated_by`), KEY `companies_default_task_status_foreign` (`default_task_status`), CONSTRAINT `companies_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `companies_default_task_status_foreign` FOREIGN KEY (`default_task_status`) REFERENCES `taskboard_columns` (`id`) ON UPDATE CASCADE, CONSTRAINT `companies_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `company_addresses`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `company_addresses` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `address` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL, `is_default` tinyint(1) NOT NULL, `tax_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `tax_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `location` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `company_addresses_company_id_foreign` (`company_id`), CONSTRAINT `company_addresses_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `contract_discussions`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `contract_discussions` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `contract_id` bigint unsigned NOT NULL, `from` int unsigned NOT NULL, `message` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `contract_discussions_company_id_foreign` (`company_id`), KEY `contract_discussions_contract_id_foreign` (`contract_id`), KEY `contract_discussions_from_foreign` (`from`), KEY `contract_discussions_added_by_foreign` (`added_by`), KEY `contract_discussions_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `contract_discussions_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `contract_discussions_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `contract_discussions_contract_id_foreign` FOREIGN KEY (`contract_id`) REFERENCES `contracts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `contract_discussions_from_foreign` FOREIGN KEY (`from`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `contract_discussions_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `contract_files`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `contract_files` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `contract_id` bigint unsigned NOT NULL, `filename` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `hashname` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `size` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `google_url` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `dropbox_link` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `external_link_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `external_link` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` text COLLATE utf8mb4_unicode_ci, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `contract_files_company_id_foreign` (`company_id`), KEY `contract_files_user_id_foreign` (`user_id`), KEY `contract_files_contract_id_foreign` (`contract_id`), KEY `contract_files_added_by_foreign` (`added_by`), KEY `contract_files_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `contract_files_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `contract_files_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `contract_files_contract_id_foreign` FOREIGN KEY (`contract_id`) REFERENCES `contracts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `contract_files_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `contract_files_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `contract_renews`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `contract_renews` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `renewed_by` int unsigned NOT NULL, `contract_id` bigint unsigned NOT NULL, `start_date` date NOT NULL, `end_date` date NOT NULL, `amount` decimal(12,2) NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `contract_renews_company_id_foreign` (`company_id`), KEY `contract_renews_renewed_by_foreign` (`renewed_by`), KEY `contract_renews_contract_id_foreign` (`contract_id`), KEY `contract_renews_added_by_foreign` (`added_by`), KEY `contract_renews_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `contract_renews_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `contract_renews_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `contract_renews_contract_id_foreign` FOREIGN KEY (`contract_id`) REFERENCES `contracts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `contract_renews_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `contract_renews_renewed_by_foreign` FOREIGN KEY (`renewed_by`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `contract_signs`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `contract_signs` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `contract_id` bigint unsigned NOT NULL, `full_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `signature` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `contract_signs_contract_id_foreign` (`contract_id`), CONSTRAINT `contract_signs_contract_id_foreign` FOREIGN KEY (`contract_id`) REFERENCES `contracts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `contract_types`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `contract_types` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `contract_types_company_id_foreign` (`company_id`), CONSTRAINT `contract_types_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `contracts`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `contracts` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `client_id` int unsigned NOT NULL, `subject` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `amount` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `original_amount` decimal(15,2) NOT NULL, `contract_type_id` bigint unsigned DEFAULT NULL, `start_date` date NOT NULL, `original_start_date` date NOT NULL, `end_date` date DEFAULT NULL, `original_end_date` date DEFAULT NULL, `description` longtext COLLATE utf8mb4_unicode_ci, `contract_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `company_logo` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `alternate_address` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `cell` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `office` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `city` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `state` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `country` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `postal_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `contract_detail` longtext COLLATE utf8mb4_unicode_ci, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `hash` text COLLATE utf8mb4_unicode_ci, `currency_id` int unsigned DEFAULT NULL, `event_id` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `contracts_company_id_foreign` (`company_id`), KEY `contracts_client_id_foreign` (`client_id`), KEY `contracts_contract_type_id_foreign` (`contract_type_id`), KEY `contracts_added_by_foreign` (`added_by`), KEY `contracts_last_updated_by_foreign` (`last_updated_by`), KEY `contracts_currency_id_foreign` (`currency_id`), CONSTRAINT `contracts_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `contracts_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `contracts_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `contracts_contract_type_id_foreign` FOREIGN KEY (`contract_type_id`) REFERENCES `contract_types` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `contracts_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `contracts_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `conversation`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `conversation` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_one` int unsigned NOT NULL, `user_two` int unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `conversation_company_id_foreign` (`company_id`), KEY `conversation_user_one_foreign` (`user_one`), KEY `conversation_user_two_foreign` (`user_two`), CONSTRAINT `conversation_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `conversation_reply`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `conversation_reply` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `conversation_id` int unsigned NOT NULL, `reply` text COLLATE utf8mb4_unicode_ci NOT NULL, `user_id` int unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `conversation_reply_company_id_foreign` (`company_id`), KEY `conversation_reply_conversation_id_foreign` (`conversation_id`), KEY `conversation_reply_user_id_foreign` (`user_id`), CONSTRAINT `conversation_reply_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `conversation_reply_conversation_id_foreign` FOREIGN KEY (`conversation_id`) REFERENCES `conversation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `conversation_reply_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `countries`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `countries` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `iso` char(2) COLLATE utf8mb4_unicode_ci NOT NULL, `name` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL, `nicename` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL, `iso3` char(3) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `numcode` smallint DEFAULT NULL, `phonecode` int NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `credit_note_item_images`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `credit_note_item_images` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `credit_note_item_id` int unsigned NOT NULL, `filename` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `hashname` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `external_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `credit_note_item_images_credit_note_item_id_foreign` (`credit_note_item_id`), CONSTRAINT `credit_note_item_images_credit_note_item_id_foreign` FOREIGN KEY (`credit_note_item_id`) REFERENCES `credit_note_items` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `credit_note_items`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `credit_note_items` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `credit_note_id` int unsigned NOT NULL, `item_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `type` enum('item','discount','tax') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'item', `quantity` int NOT NULL, `unit_price` double(8,2) NOT NULL, `amount` double(8,2) NOT NULL, `taxes` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `hsn_sac_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `item_summary` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `credit_note_items_credit_note_id_foreign` (`credit_note_id`), CONSTRAINT `credit_note_items_credit_note_id_foreign` FOREIGN KEY (`credit_note_id`) REFERENCES `credit_notes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `credit_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `credit_notes` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `project_id` int unsigned DEFAULT NULL, `client_id` int unsigned DEFAULT NULL, `cn_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `invoice_id` int unsigned DEFAULT NULL, `issue_date` date NOT NULL, `due_date` date NOT NULL, `discount` double NOT NULL DEFAULT '0', `discount_type` enum('percent','fixed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'percent', `sub_total` double(15,2) NOT NULL, `total` double(15,2) NOT NULL, `adjustment_amount` double(8,2) DEFAULT NULL, `currency_id` int unsigned DEFAULT NULL, `status` enum('closed','open') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'open', `recurring` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `billing_frequency` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `billing_interval` int DEFAULT NULL, `billing_cycle` int DEFAULT NULL, `file` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `file_original_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `note` text COLLATE utf8mb4_unicode_ci, `deleted_at` timestamp NULL DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `calculate_tax` enum('after_discount','before_discount') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'after_discount', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `credit_notes_company_id_foreign` (`company_id`), KEY `credit_notes_project_id_foreign` (`project_id`), KEY `credit_notes_client_id_foreign` (`client_id`), KEY `credit_notes_currency_id_foreign` (`currency_id`), KEY `credit_notes_added_by_foreign` (`added_by`), KEY `credit_notes_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `credit_notes_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `credit_notes_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `credit_notes_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `credit_notes_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `credit_notes_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `credit_notes_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `currencies`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `currencies` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `currency_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `currency_symbol` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `currency_code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `exchange_rate` double DEFAULT NULL, `is_cryptocurrency` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `usd_price` double DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `currencies_company_id_foreign` (`company_id`), CONSTRAINT `currencies_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `currency_format_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `currency_format_settings` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `currency_position` enum('left','right','left_with_space','right_with_space') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'left', `no_of_decimal` int unsigned NOT NULL, `thousand_separator` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `decimal_separator` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `currency_format_settings_company_id_foreign` (`company_id`), CONSTRAINT `currency_format_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `custom_field_groups`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `custom_field_groups` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `model` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `custom_field_groups_company_id_foreign` (`company_id`), KEY `custom_field_groups_model_index` (`model`), CONSTRAINT `custom_field_groups_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `custom_fields`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `custom_fields` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `custom_field_group_id` int unsigned DEFAULT NULL, `label` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `type` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL, `required` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `values` varchar(5000) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `export` tinyint(1) DEFAULT '0', PRIMARY KEY (`id`), KEY `custom_fields_company_id_foreign` (`company_id`), KEY `custom_fields_custom_field_group_id_foreign` (`custom_field_group_id`), CONSTRAINT `custom_fields_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `custom_fields_custom_field_group_id_foreign` FOREIGN KEY (`custom_field_group_id`) REFERENCES `custom_field_groups` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `custom_fields_data`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `custom_fields_data` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `custom_field_id` int unsigned NOT NULL, `model_id` int unsigned NOT NULL, `model` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `value` varchar(10000) COLLATE utf8mb4_unicode_ci NOT NULL, PRIMARY KEY (`id`), KEY `custom_fields_data_custom_field_id_foreign` (`custom_field_id`), KEY `custom_fields_data_model_index` (`model`), CONSTRAINT `custom_fields_data_custom_field_id_foreign` FOREIGN KEY (`custom_field_id`) REFERENCES `custom_fields` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `dashboard_widgets`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `dashboard_widgets` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `widget_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `status` tinyint(1) NOT NULL DEFAULT '1', `dashboard_type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `dashboard_widgets_company_id_foreign` (`company_id`), CONSTRAINT `dashboard_widgets_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `database_backup_cron_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `database_backup_cron_settings` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `status` enum('active','inactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'inactive', `hour_of_day` time DEFAULT NULL, `backup_after_days` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `delete_backup_after_days` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `database_backups`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `database_backups` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `filename` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `designations`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `designations` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `designations_company_id_foreign` (`company_id`), KEY `designations_added_by_foreign` (`added_by`), KEY `designations_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `designations_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `designations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `designations_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `discussion_categories`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `discussion_categories` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `order` int NOT NULL DEFAULT '1', `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `color` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `discussion_categories_company_id_foreign` (`company_id`), CONSTRAINT `discussion_categories_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `discussion_files`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `discussion_files` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `discussion_id` int unsigned DEFAULT NULL, `discussion_reply_id` int unsigned DEFAULT NULL, `filename` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` text COLLATE utf8mb4_unicode_ci, `google_url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `hashname` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `dropbox_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `external_link_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `discussion_files_company_id_foreign` (`company_id`), KEY `discussion_files_user_id_foreign` (`user_id`), KEY `discussion_files_discussion_id_foreign` (`discussion_id`), KEY `discussion_files_discussion_reply_id_foreign` (`discussion_reply_id`), CONSTRAINT `discussion_files_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `discussion_files_discussion_id_foreign` FOREIGN KEY (`discussion_id`) REFERENCES `discussions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `discussion_files_discussion_reply_id_foreign` FOREIGN KEY (`discussion_reply_id`) REFERENCES `discussion_replies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `discussion_files_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `discussion_replies`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `discussion_replies` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `discussion_id` int unsigned NOT NULL, `user_id` int unsigned NOT NULL, `body` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `deleted_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `discussion_replies_discussion_id_foreign` (`discussion_id`), KEY `discussion_replies_user_id_foreign` (`user_id`), KEY `discussion_replies_company_id_foreign` (`company_id`), CONSTRAINT `discussion_replies_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `discussion_replies_discussion_id_foreign` FOREIGN KEY (`discussion_id`) REFERENCES `discussions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `discussion_replies_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `discussions`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `discussions` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `discussion_category_id` int unsigned DEFAULT '1', `project_id` int unsigned DEFAULT NULL, `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `color` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT '#232629', `user_id` int unsigned NOT NULL, `pinned` tinyint(1) NOT NULL DEFAULT '0', `closed` tinyint(1) NOT NULL DEFAULT '0', `deleted_at` timestamp NULL DEFAULT NULL, `last_reply_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `best_answer_id` int unsigned DEFAULT NULL, `last_reply_by_id` int unsigned DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `discussions_discussion_category_id_foreign` (`discussion_category_id`), KEY `discussions_project_id_foreign` (`project_id`), KEY `discussions_user_id_foreign` (`user_id`), KEY `discussions_best_answer_id_foreign` (`best_answer_id`), KEY `discussions_last_reply_by_id_foreign` (`last_reply_by_id`), KEY `discussions_added_by_foreign` (`added_by`), KEY `discussions_last_updated_by_foreign` (`last_updated_by`), KEY `discussions_company_id_foreign` (`company_id`), CONSTRAINT `discussions_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `discussions_best_answer_id_foreign` FOREIGN KEY (`best_answer_id`) REFERENCES `discussion_replies` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `discussions_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `discussions_discussion_category_id_foreign` FOREIGN KEY (`discussion_category_id`) REFERENCES `discussion_categories` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `discussions_last_reply_by_id_foreign` FOREIGN KEY (`last_reply_by_id`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `discussions_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `discussions_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `discussions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `email_notification_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `email_notification_settings` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `slug` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `setting_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `send_email` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `send_slack` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `send_push` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', PRIMARY KEY (`id`), KEY `email_notification_settings_company_id_foreign` (`company_id`), CONSTRAINT `email_notification_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `emergency_contacts`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `emergency_contacts` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `mobile` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `relation` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `address` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `emergency_contacts_company_id_foreign` (`company_id`), KEY `emergency_contacts_user_id_foreign` (`user_id`), KEY `emergency_contacts_added_by_foreign` (`added_by`), KEY `emergency_contacts_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `emergency_contacts_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `emergency_contacts_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `emergency_contacts_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `emergency_contacts_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `employee_details`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `employee_details` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `employee_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `address` text COLLATE utf8mb4_unicode_ci, `hourly_rate` double DEFAULT NULL, `slack_username` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `department_id` int unsigned DEFAULT NULL, `designation_id` bigint unsigned DEFAULT NULL, `joining_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `last_date` date DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `attendance_reminder` date DEFAULT NULL, `date_of_birth` date DEFAULT NULL, `calendar_view` text COLLATE utf8mb4_unicode_ci, `about_me` text COLLATE utf8mb4_unicode_ci, `reporting_to` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `employee_details_employee_id_unique` (`employee_id`), UNIQUE KEY `employee_details_slack_username_unique` (`slack_username`), KEY `employee_details_company_id_foreign` (`company_id`), KEY `employee_details_user_id_foreign` (`user_id`), KEY `employee_details_department_id_foreign` (`department_id`), KEY `employee_details_designation_id_foreign` (`designation_id`), KEY `employee_details_added_by_foreign` (`added_by`), KEY `employee_details_last_updated_by_foreign` (`last_updated_by`), KEY `employee_details_reporting_to_foreign` (`reporting_to`), CONSTRAINT `employee_details_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `employee_details_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `employee_details_department_id_foreign` FOREIGN KEY (`department_id`) REFERENCES `teams` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `employee_details_designation_id_foreign` FOREIGN KEY (`designation_id`) REFERENCES `designations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `employee_details_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `employee_details_reporting_to_foreign` FOREIGN KEY (`reporting_to`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `employee_details_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `employee_docs`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `employee_docs` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL, `filename` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL, `hashname` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL, `size` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `employee_docs_company_id_foreign` (`company_id`), KEY `employee_docs_user_id_foreign` (`user_id`), KEY `employee_docs_added_by_foreign` (`added_by`), KEY `employee_docs_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `employee_docs_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `employee_docs_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `employee_docs_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `employee_docs_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `employee_leave_quotas`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `employee_leave_quotas` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `user_id` int unsigned NOT NULL, `leave_type_id` int unsigned NOT NULL, `no_of_leaves` int NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `employee_leave_quotas_user_id_foreign` (`user_id`), KEY `employee_leave_quotas_leave_type_id_foreign` (`leave_type_id`), CONSTRAINT `employee_leave_quotas_leave_type_id_foreign` FOREIGN KEY (`leave_type_id`) REFERENCES `leave_types` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `employee_leave_quotas_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `employee_shift_change_requests`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `employee_shift_change_requests` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `shift_schedule_id` bigint unsigned NOT NULL, `employee_shift_id` bigint unsigned NOT NULL, `status` enum('waiting','accepted','rejected') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'waiting', `reason` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `employee_shift_change_requests_company_id_foreign` (`company_id`), KEY `employee_shift_change_requests_shift_schedule_id_foreign` (`shift_schedule_id`), KEY `employee_shift_change_requests_employee_shift_id_foreign` (`employee_shift_id`), CONSTRAINT `employee_shift_change_requests_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `employee_shift_change_requests_employee_shift_id_foreign` FOREIGN KEY (`employee_shift_id`) REFERENCES `employee_shifts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `employee_shift_change_requests_shift_schedule_id_foreign` FOREIGN KEY (`shift_schedule_id`) REFERENCES `employee_shift_schedules` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `employee_shift_schedules`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `employee_shift_schedules` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `user_id` int unsigned NOT NULL, `date` date NOT NULL, `employee_shift_id` bigint unsigned NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `shift_start_time` datetime DEFAULT NULL, `shift_end_time` datetime DEFAULT NULL, `remarks` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `employee_shift_schedules_user_id_foreign` (`user_id`), KEY `employee_shift_schedules_date_index` (`date`), KEY `employee_shift_schedules_employee_shift_id_foreign` (`employee_shift_id`), KEY `employee_shift_schedules_added_by_foreign` (`added_by`), KEY `employee_shift_schedules_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `employee_shift_schedules_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `employee_shift_schedules_employee_shift_id_foreign` FOREIGN KEY (`employee_shift_id`) REFERENCES `employee_shifts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `employee_shift_schedules_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `employee_shift_schedules_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `employee_shifts`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `employee_shifts` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `shift_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `shift_short_code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `color` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `office_start_time` time NOT NULL, `office_end_time` time NOT NULL, `halfday_mark_time` time DEFAULT NULL, `late_mark_duration` tinyint NOT NULL, `clockin_in_day` tinyint NOT NULL, `office_open_days` text COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `employee_shifts_company_id_foreign` (`company_id`), CONSTRAINT `employee_shifts_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `employee_skills`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `employee_skills` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `skill_id` int unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `employee_skills_company_id_foreign` (`company_id`), KEY `employee_skills_user_id_foreign` (`user_id`), KEY `employee_skills_skill_id_foreign` (`skill_id`), CONSTRAINT `employee_skills_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `employee_skills_skill_id_foreign` FOREIGN KEY (`skill_id`) REFERENCES `skills` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `employee_skills_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `employee_teams`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `employee_teams` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `team_id` int unsigned NOT NULL, `user_id` int unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `employee_teams_company_id_foreign` (`company_id`), KEY `employee_teams_team_id_foreign` (`team_id`), KEY `employee_teams_user_id_foreign` (`user_id`), CONSTRAINT `employee_teams_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `employee_teams_team_id_foreign` FOREIGN KEY (`team_id`) REFERENCES `teams` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `employee_teams_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `estimate_item_images`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `estimate_item_images` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `estimate_item_id` int unsigned NOT NULL, `filename` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `hashname` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `external_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `estimate_item_images_estimate_item_id_foreign` (`estimate_item_id`), CONSTRAINT `estimate_item_images_estimate_item_id_foreign` FOREIGN KEY (`estimate_item_id`) REFERENCES `estimate_items` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `estimate_items`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `estimate_items` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `estimate_id` int unsigned NOT NULL, `item_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `item_summary` text COLLATE utf8mb4_unicode_ci, `type` enum('item','discount','tax') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'item', `quantity` double(16,2) NOT NULL, `unit_price` double(16,2) NOT NULL, `amount` double(16,2) NOT NULL, `taxes` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `hsn_sac_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `estimate_items_estimate_id_foreign` (`estimate_id`), CONSTRAINT `estimate_items_estimate_id_foreign` FOREIGN KEY (`estimate_id`) REFERENCES `estimates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `estimates`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `estimates` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `client_id` int unsigned NOT NULL, `estimate_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `valid_till` date NOT NULL, `sub_total` double(16,2) NOT NULL, `discount` double NOT NULL DEFAULT '0', `discount_type` enum('percent','fixed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'percent', `total` double(16,2) NOT NULL, `currency_id` int unsigned DEFAULT NULL, `status` enum('declined','accepted','waiting','sent','draft','canceled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'waiting', `note` mediumtext COLLATE utf8mb4_unicode_ci, `description` longtext COLLATE utf8mb4_unicode_ci, `send_status` tinyint(1) NOT NULL DEFAULT '1', `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `hash` text COLLATE utf8mb4_unicode_ci, `calculate_tax` enum('after_discount','before_discount') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'after_discount', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `estimates_estimate_number_unique` (`estimate_number`), KEY `estimates_company_id_foreign` (`company_id`), KEY `estimates_client_id_foreign` (`client_id`), KEY `estimates_currency_id_foreign` (`currency_id`), KEY `estimates_added_by_foreign` (`added_by`), KEY `estimates_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `estimates_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `estimates_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `estimates_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `estimates_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `estimates_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `event_attendees`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `event_attendees` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `event_id` int unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `event_attendees_company_id_foreign` (`company_id`), KEY `event_attendees_user_id_foreign` (`user_id`), KEY `event_attendees_event_id_foreign` (`event_id`), CONSTRAINT `event_attendees_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `event_attendees_event_id_foreign` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `event_attendees_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `events`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `events` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `event_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `label_color` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `where` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL, `start_date_time` datetime NOT NULL, `end_date_time` datetime NOT NULL, `repeat` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `repeat_every` int DEFAULT NULL, `repeat_cycles` int DEFAULT NULL, `repeat_type` enum('day','week','month','year') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'day', `send_reminder` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `remind_time` int DEFAULT NULL, `remind_type` enum('day','hour','minute') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'day', `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `event_id` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `events_company_id_foreign` (`company_id`), KEY `events_added_by_foreign` (`added_by`), KEY `events_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `events_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `events_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `events_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `expenses`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `expenses` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `item_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `purchase_date` date NOT NULL, `purchase_from` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `price` double(16,2) NOT NULL, `currency_id` int unsigned NOT NULL, `project_id` int unsigned DEFAULT NULL, `bill` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `user_id` int unsigned NOT NULL, `status` enum('pending','approved','rejected') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending', `can_claim` tinyint(1) NOT NULL DEFAULT '1', `category_id` bigint unsigned DEFAULT NULL, `expenses_recurring_id` bigint unsigned DEFAULT NULL, `created_by` int unsigned DEFAULT NULL, `description` text COLLATE utf8mb4_unicode_ci, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `approver_id` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `expenses_company_id_foreign` (`company_id`), KEY `expenses_currency_id_foreign` (`currency_id`), KEY `expenses_user_id_foreign` (`user_id`), KEY `expenses_category_id_foreign` (`category_id`), KEY `expenses_expenses_recurring_id_foreign` (`expenses_recurring_id`), KEY `expenses_created_by_foreign` (`created_by`), KEY `expenses_added_by_foreign` (`added_by`), KEY `expenses_last_updated_by_foreign` (`last_updated_by`), KEY `expenses_approver_id_foreign` (`approver_id`), CONSTRAINT `expenses_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `expenses_approver_id_foreign` FOREIGN KEY (`approver_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `expenses_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `expenses_category` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `expenses_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `expenses_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON UPDATE CASCADE, CONSTRAINT `expenses_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `expenses_expenses_recurring_id_foreign` FOREIGN KEY (`expenses_recurring_id`) REFERENCES `expenses_recurring` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `expenses_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `expenses_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `expenses_category`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `expenses_category` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `category_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `expenses_category_company_id_foreign` (`company_id`), KEY `expenses_category_added_by_foreign` (`added_by`), KEY `expenses_category_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `expenses_category_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `expenses_category_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `expenses_category_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `expenses_category_roles`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `expenses_category_roles` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `expenses_category_id` bigint unsigned DEFAULT NULL, `role_id` int unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `expenses_category_roles_company_id_foreign` (`company_id`), KEY `expenses_category_roles_expenses_category_id_foreign` (`expenses_category_id`), KEY `expenses_category_roles_role_id_foreign` (`role_id`), CONSTRAINT `expenses_category_roles_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `expenses_category_roles_expenses_category_id_foreign` FOREIGN KEY (`expenses_category_id`) REFERENCES `expenses_category` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `expenses_category_roles_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `expenses_recurring`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `expenses_recurring` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `category_id` bigint unsigned DEFAULT NULL, `currency_id` int unsigned DEFAULT NULL, `project_id` int unsigned DEFAULT NULL, `user_id` int unsigned DEFAULT NULL, `created_by` int unsigned DEFAULT NULL, `item_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `day_of_month` int DEFAULT '1', `day_of_week` int DEFAULT '1', `payment_method` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `rotation` enum('monthly','weekly','bi-weekly','quarterly','half-yearly','annually','daily') COLLATE utf8mb4_unicode_ci NOT NULL, `billing_cycle` int DEFAULT NULL, `unlimited_recurring` tinyint(1) NOT NULL DEFAULT '0', `price` double NOT NULL, `bill` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `status` enum('active','inactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active', `description` text COLLATE utf8mb4_unicode_ci, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `purchase_from` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `expenses_recurring_company_id_foreign` (`company_id`), KEY `expenses_recurring_category_id_foreign` (`category_id`), KEY `expenses_recurring_currency_id_foreign` (`currency_id`), KEY `expenses_recurring_project_id_foreign` (`project_id`), KEY `expenses_recurring_user_id_foreign` (`user_id`), KEY `expenses_recurring_created_by_foreign` (`created_by`), KEY `expenses_recurring_added_by_foreign` (`added_by`), KEY `expenses_recurring_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `expenses_recurring_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `expenses_recurring_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `expenses_category` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `expenses_recurring_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `expenses_recurring_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON UPDATE CASCADE, CONSTRAINT `expenses_recurring_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `expenses_recurring_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `expenses_recurring_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `expenses_recurring_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `failed_jobs`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `failed_jobs` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `uuid` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `connection` text COLLATE utf8mb4_unicode_ci NOT NULL, `queue` text COLLATE utf8mb4_unicode_ci NOT NULL, `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `file_storage`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `file_storage` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `path` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `filename` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `size` int unsigned NOT NULL, `storage_location` enum('local','aws_s3') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'local', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `file_storage_company_id_foreign` (`company_id`), CONSTRAINT `file_storage_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `file_storage_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `file_storage_settings` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `filesystem` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `auth_keys` text COLLATE utf8mb4_unicode_ci, `status` enum('enabled','disabled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'disabled', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `gdpr_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `gdpr_settings` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `enable_gdpr` tinyint(1) NOT NULL DEFAULT '0', `show_customer_area` tinyint(1) NOT NULL DEFAULT '0', `show_customer_footer` tinyint(1) NOT NULL DEFAULT '0', `top_information_block` longtext COLLATE utf8mb4_unicode_ci, `enable_export` tinyint(1) NOT NULL DEFAULT '0', `data_removal` tinyint(1) NOT NULL DEFAULT '0', `lead_removal_public_form` tinyint(1) NOT NULL DEFAULT '0', `terms_customer_footer` tinyint(1) NOT NULL DEFAULT '0', `terms` longtext COLLATE utf8mb4_unicode_ci, `policy` longtext COLLATE utf8mb4_unicode_ci, `public_lead_edit` tinyint(1) NOT NULL DEFAULT '0', `consent_customer` tinyint(1) NOT NULL DEFAULT '0', `consent_leads` tinyint(1) NOT NULL DEFAULT '0', `consent_block` longtext COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `google_calendar_modules`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `google_calendar_modules` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `lead_status` tinyint(1) NOT NULL DEFAULT '0', `leave_status` tinyint(1) NOT NULL DEFAULT '0', `invoice_status` tinyint(1) NOT NULL DEFAULT '0', `contract_status` tinyint(1) NOT NULL DEFAULT '0', `task_status` tinyint(1) NOT NULL DEFAULT '0', `event_status` tinyint(1) NOT NULL DEFAULT '0', `holiday_status` tinyint(1) NOT NULL DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `google_calendar_modules_company_id_foreign` (`company_id`), CONSTRAINT `google_calendar_modules_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `holidays`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `holidays` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `date` date NOT NULL, `occassion` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `event_id` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `holidays_company_id_foreign` (`company_id`), KEY `holidays_date_index` (`date`), KEY `holidays_added_by_foreign` (`added_by`), KEY `holidays_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `holidays_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `holidays_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `holidays_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `invoice_item_images`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `invoice_item_images` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `invoice_item_id` int unsigned NOT NULL, `filename` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `hashname` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `external_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `invoice_item_images_invoice_item_id_foreign` (`invoice_item_id`), CONSTRAINT `invoice_item_images_invoice_item_id_foreign` FOREIGN KEY (`invoice_item_id`) REFERENCES `invoice_items` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `invoice_items`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `invoice_items` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `invoice_id` int unsigned NOT NULL, `item_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `item_summary` text COLLATE utf8mb4_unicode_ci, `type` enum('item','discount','tax') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'item', `quantity` double(16,2) NOT NULL, `unit_price` double(16,2) NOT NULL, `amount` double(16,2) NOT NULL, `taxes` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `hsn_sac_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `invoice_items_invoice_id_foreign` (`invoice_id`), CONSTRAINT `invoice_items_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `invoice_recurring`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `invoice_recurring` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `currency_id` int unsigned DEFAULT NULL, `project_id` int unsigned DEFAULT NULL, `client_id` int unsigned DEFAULT NULL, `user_id` int unsigned DEFAULT NULL, `created_by` int unsigned DEFAULT NULL, `issue_date` date NOT NULL, `due_date` date NOT NULL, `sub_total` double NOT NULL DEFAULT '0', `total` double NOT NULL DEFAULT '0', `discount` double NOT NULL DEFAULT '0', `discount_type` enum('percent','fixed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'percent', `status` enum('active','inactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active', `file` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `file_original_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `note` text COLLATE utf8mb4_unicode_ci, `show_shipping_address` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `day_of_month` int DEFAULT '1', `day_of_week` int DEFAULT '1', `payment_method` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `rotation` enum('monthly','weekly','bi-weekly','quarterly','half-yearly','annually','daily') COLLATE utf8mb4_unicode_ci NOT NULL, `billing_cycle` int DEFAULT NULL, `client_can_stop` tinyint(1) NOT NULL DEFAULT '1', `unlimited_recurring` tinyint(1) NOT NULL DEFAULT '0', `deleted_at` datetime DEFAULT NULL, `shipping_address` text COLLATE utf8mb4_unicode_ci, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `calculate_tax` enum('after_discount','before_discount') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'after_discount', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `invoice_recurring_company_id_foreign` (`company_id`), KEY `invoice_recurring_currency_id_foreign` (`currency_id`), KEY `invoice_recurring_project_id_foreign` (`project_id`), KEY `invoice_recurring_client_id_foreign` (`client_id`), KEY `invoice_recurring_user_id_foreign` (`user_id`), KEY `invoice_recurring_created_by_foreign` (`created_by`), KEY `invoice_recurring_added_by_foreign` (`added_by`), KEY `invoice_recurring_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `invoice_recurring_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `invoice_recurring_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoice_recurring_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoice_recurring_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `invoice_recurring_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoice_recurring_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `invoice_recurring_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoice_recurring_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `invoice_recurring_item_images`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `invoice_recurring_item_images` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `invoice_recurring_item_id` int unsigned NOT NULL, `filename` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `hashname` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `external_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `invoice_recurring_item_images_invoice_recurring_item_id_foreign` (`invoice_recurring_item_id`), CONSTRAINT `invoice_recurring_item_images_invoice_recurring_item_id_foreign` FOREIGN KEY (`invoice_recurring_item_id`) REFERENCES `invoice_recurring_items` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `invoice_recurring_items`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `invoice_recurring_items` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `invoice_recurring_id` bigint unsigned NOT NULL, `item_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `quantity` double NOT NULL, `unit_price` double NOT NULL, `amount` double NOT NULL, `taxes` text COLLATE utf8mb4_unicode_ci, `type` enum('item','discount','tax') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'item', `item_summary` text COLLATE utf8mb4_unicode_ci, `hsn_sac_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `invoice_recurring_items_invoice_recurring_id_foreign` (`invoice_recurring_id`), CONSTRAINT `invoice_recurring_items_invoice_recurring_id_foreign` FOREIGN KEY (`invoice_recurring_id`) REFERENCES `invoice_recurring` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `invoice_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `invoice_settings` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `invoice_prefix` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `invoice_digit` int unsigned NOT NULL DEFAULT '3', `estimate_prefix` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'EST', `estimate_digit` int unsigned NOT NULL DEFAULT '3', `credit_note_prefix` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'CN', `credit_note_digit` int unsigned NOT NULL DEFAULT '3', `template` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `due_after` int NOT NULL, `invoice_terms` text COLLATE utf8mb4_unicode_ci NOT NULL, `estimate_terms` text COLLATE utf8mb4_unicode_ci, `gst_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `show_gst` enum('yes','no') COLLATE utf8mb4_unicode_ci DEFAULT 'no', `logo` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `hsn_sac_code_show` tinyint(1) NOT NULL DEFAULT '0', `locale` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT 'en', `send_reminder` int NOT NULL DEFAULT '0', `reminder` enum('after','every') COLLATE utf8mb4_unicode_ci DEFAULT NULL, `send_reminder_after` int NOT NULL DEFAULT '0', `tax_calculation_msg` tinyint(1) NOT NULL DEFAULT '0', `show_project` int NOT NULL DEFAULT '0', `show_client_name` enum('yes','no') COLLATE utf8mb4_unicode_ci DEFAULT 'no', `show_client_email` enum('yes','no') COLLATE utf8mb4_unicode_ci DEFAULT 'no', `show_client_phone` enum('yes','no') COLLATE utf8mb4_unicode_ci DEFAULT 'no', `show_client_company_address` enum('yes','no') COLLATE utf8mb4_unicode_ci DEFAULT 'no', `show_client_company_name` enum('yes','no') COLLATE utf8mb4_unicode_ci DEFAULT 'no', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `invoice_settings_company_id_foreign` (`company_id`), CONSTRAINT `invoice_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `invoices`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `invoices` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `project_id` int unsigned DEFAULT NULL, `client_id` int unsigned DEFAULT NULL, `order_id` bigint unsigned DEFAULT NULL, `invoice_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `issue_date` date NOT NULL, `due_date` date NOT NULL, `sub_total` double(16,2) NOT NULL, `discount` double NOT NULL DEFAULT '0', `discount_type` enum('percent','fixed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'percent', `total` double(16,2) NOT NULL, `currency_id` int unsigned DEFAULT NULL, `status` enum('paid','unpaid','partial','canceled','draft') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'unpaid', `recurring` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `billing_cycle` int DEFAULT NULL, `billing_interval` int DEFAULT NULL, `billing_frequency` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `file` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `file_original_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `note` text COLLATE utf8mb4_unicode_ci, `credit_note` tinyint(1) NOT NULL DEFAULT '0', `show_shipping_address` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `estimate_id` int unsigned DEFAULT NULL, `send_status` tinyint(1) NOT NULL DEFAULT '1', `due_amount` double(8,2) NOT NULL DEFAULT '0.00', `parent_id` int unsigned DEFAULT NULL, `invoice_recurring_id` bigint unsigned DEFAULT NULL, `created_by` int unsigned DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `hash` text COLLATE utf8mb4_unicode_ci, `calculate_tax` enum('after_discount','before_discount') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'after_discount', `company_address_id` bigint unsigned DEFAULT NULL, `event_id` text COLLATE utf8mb4_unicode_ci, `custom_invoice_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `invoices_invoice_number_unique` (`invoice_number`), KEY `invoices_company_id_foreign` (`company_id`), KEY `invoices_project_id_foreign` (`project_id`), KEY `invoices_client_id_foreign` (`client_id`), KEY `invoices_order_id_foreign` (`order_id`), KEY `invoices_due_date_index` (`due_date`), KEY `invoices_currency_id_foreign` (`currency_id`), KEY `invoices_estimate_id_foreign` (`estimate_id`), KEY `invoices_parent_id_foreign` (`parent_id`), KEY `invoices_invoice_recurring_id_foreign` (`invoice_recurring_id`), KEY `invoices_created_by_foreign` (`created_by`), KEY `invoices_added_by_foreign` (`added_by`), KEY `invoices_last_updated_by_foreign` (`last_updated_by`), KEY `invoices_company_address_id_foreign` (`company_address_id`), CONSTRAINT `invoices_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `invoices_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoices_company_address_id_foreign` FOREIGN KEY (`company_address_id`) REFERENCES `company_addresses` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `invoices_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoices_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON UPDATE CASCADE, CONSTRAINT `invoices_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoices_estimate_id_foreign` FOREIGN KEY (`estimate_id`) REFERENCES `estimates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoices_invoice_recurring_id_foreign` FOREIGN KEY (`invoice_recurring_id`) REFERENCES `invoice_recurring` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoices_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `invoices_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `invoices_parent_id_foreign` FOREIGN KEY (`parent_id`) REFERENCES `invoices` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoices_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `issues`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `issues` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `description` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL, `user_id` int unsigned DEFAULT NULL, `project_id` int unsigned DEFAULT NULL, `status` enum('pending','resolved') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `issues_company_id_foreign` (`company_id`), KEY `issues_user_id_foreign` (`user_id`), KEY `issues_project_id_foreign` (`project_id`), CONSTRAINT `issues_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `issues_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `issues_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `job_batches`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `job_batches` ( `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `total_jobs` int NOT NULL, `pending_jobs` int NOT NULL, `failed_jobs` int NOT NULL, `failed_job_ids` text COLLATE utf8mb4_unicode_ci NOT NULL, `options` mediumtext COLLATE utf8mb4_unicode_ci, `cancelled_at` int DEFAULT NULL, `created_at` int NOT NULL, `finished_at` int DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `jobs`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `jobs` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `queue` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `attempts` tinyint unsigned NOT NULL, `reserved_at` int unsigned DEFAULT NULL, `available_at` int unsigned NOT NULL, `created_at` int unsigned NOT NULL, PRIMARY KEY (`id`), KEY `jobs_queue_index` (`queue`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `knowledge_bases`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `knowledge_bases` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `to` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'employee', `heading` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `category_id` int unsigned DEFAULT NULL, `description` mediumtext COLLATE utf8mb4_unicode_ci, `added_by` int unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `knowledge_bases_company_id_foreign` (`company_id`), KEY `knowledge_bases_category_id_foreign` (`category_id`), CONSTRAINT `knowledge_bases_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `knowledge_categories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `knowledge_bases_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `knowledge_categories`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `knowledge_categories` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `knowledge_categories_company_id_foreign` (`company_id`), CONSTRAINT `knowledge_categories_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `language_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `language_settings` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `language_code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `language_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `status` enum('enabled','disabled') COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `lead_agents`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `lead_agents` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `status` enum('enabled','disabled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'enabled', `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `lead_agents_company_id_foreign` (`company_id`), KEY `lead_agents_user_id_foreign` (`user_id`), KEY `lead_agents_added_by_foreign` (`added_by`), KEY `lead_agents_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `lead_agents_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `lead_agents_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `lead_agents_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `lead_agents_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `lead_category`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `lead_category` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `category_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `lead_category_company_id_foreign` (`company_id`), KEY `lead_category_added_by_foreign` (`added_by`), KEY `lead_category_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `lead_category_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `lead_category_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `lead_category_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `lead_custom_forms`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `lead_custom_forms` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `custom_fields_id` int unsigned DEFAULT NULL, `field_display_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `field_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `field_order` int NOT NULL, `status` enum('active','inactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active', `required` tinyint(1) NOT NULL DEFAULT '0', `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `lead_custom_forms_company_id_foreign` (`company_id`), KEY `lead_custom_forms_custom_fields_id_foreign` (`custom_fields_id`), KEY `lead_custom_forms_added_by_foreign` (`added_by`), KEY `lead_custom_forms_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `lead_custom_forms_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `lead_custom_forms_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `lead_custom_forms_custom_fields_id_foreign` FOREIGN KEY (`custom_fields_id`) REFERENCES `custom_fields` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `lead_custom_forms_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `lead_files`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `lead_files` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `lead_id` int unsigned NOT NULL, `user_id` int unsigned NOT NULL, `filename` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL, `hashname` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL, `size` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL, `description` text COLLATE utf8mb4_unicode_ci, `google_url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `dropbox_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `lead_files_lead_id_foreign` (`lead_id`), KEY `lead_files_user_id_foreign` (`user_id`), KEY `lead_files_added_by_foreign` (`added_by`), KEY `lead_files_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `lead_files_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `lead_files_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `lead_files_lead_id_foreign` FOREIGN KEY (`lead_id`) REFERENCES `leads` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `lead_files_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `lead_follow_up`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `lead_follow_up` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `lead_id` int unsigned NOT NULL, `remark` longtext COLLATE utf8mb4_unicode_ci, `next_follow_up_date` datetime DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `event_id` text COLLATE utf8mb4_unicode_ci, `send_reminder` enum('yes','no') COLLATE utf8mb4_unicode_ci DEFAULT 'no', `remind_time` text COLLATE utf8mb4_unicode_ci, `remind_type` enum('minute','hour','day') COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `lead_follow_up_lead_id_foreign` (`lead_id`), KEY `lead_follow_up_added_by_foreign` (`added_by`), KEY `lead_follow_up_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `lead_follow_up_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `lead_follow_up_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `lead_follow_up_lead_id_foreign` FOREIGN KEY (`lead_id`) REFERENCES `leads` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `lead_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `lead_notes` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `lead_id` int unsigned DEFAULT NULL, `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `type` tinyint(1) NOT NULL DEFAULT '0', `member_id` int unsigned DEFAULT NULL, `is_lead_show` tinyint(1) NOT NULL DEFAULT '0', `ask_password` tinyint(1) NOT NULL DEFAULT '0', `details` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `lead_notes_lead_id_foreign` (`lead_id`), KEY `lead_notes_member_id_foreign` (`member_id`), KEY `lead_notes_added_by_foreign` (`added_by`), KEY `lead_notes_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `lead_notes_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `lead_notes_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `lead_notes_lead_id_foreign` FOREIGN KEY (`lead_id`) REFERENCES `leads` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `lead_notes_member_id_foreign` FOREIGN KEY (`member_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `lead_sources`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `lead_sources` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `lead_sources_type_unique` (`type`), KEY `lead_sources_company_id_foreign` (`company_id`), KEY `lead_sources_added_by_foreign` (`added_by`), KEY `lead_sources_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `lead_sources_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `lead_sources_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `lead_sources_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `lead_status`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `lead_status` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `priority` int NOT NULL, `default` tinyint(1) NOT NULL, `label_color` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#ff0000', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `lead_status_type_unique` (`type`), KEY `lead_status_company_id_foreign` (`company_id`), CONSTRAINT `lead_status_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `lead_user_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `lead_user_notes` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `user_id` int unsigned NOT NULL, `lead_note_id` int unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `lead_user_notes_user_id_foreign` (`user_id`), KEY `lead_user_notes_lead_note_id_foreign` (`lead_note_id`), CONSTRAINT `lead_user_notes_lead_note_id_foreign` FOREIGN KEY (`lead_note_id`) REFERENCES `lead_notes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `lead_user_notes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `leads`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `leads` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `client_id` int DEFAULT NULL, `source_id` int DEFAULT NULL, `status_id` int DEFAULT NULL, `column_priority` int NOT NULL, `agent_id` bigint unsigned DEFAULT NULL, `company_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `website` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `address` text COLLATE utf8mb4_unicode_ci, `salutation` enum('mr','mrs','miss','dr','sir','madam') COLLATE utf8mb4_unicode_ci DEFAULT NULL, `client_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `client_email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `mobile` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `cell` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `office` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `city` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `state` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `country` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `postal_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `note` text COLLATE utf8mb4_unicode_ci, `next_follow_up` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'yes', `value` double DEFAULT '0', `currency_id` int unsigned DEFAULT NULL, `category_id` int unsigned DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `hash` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `leads_company_id_foreign` (`company_id`), KEY `leads_agent_id_foreign` (`agent_id`), KEY `leads_currency_id_foreign` (`currency_id`), KEY `leads_category_id_foreign` (`category_id`), KEY `leads_added_by_foreign` (`added_by`), KEY `leads_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `leads_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `leads_agent_id_foreign` FOREIGN KEY (`agent_id`) REFERENCES `lead_agents` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `leads_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `lead_category` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `leads_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `leads_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `leads_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `leave_types`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `leave_types` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `type_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `color` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `no_of_leaves` int NOT NULL DEFAULT '5', `paid` tinyint(1) NOT NULL DEFAULT '1', `monthly_limit` int NOT NULL DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `leave_types_company_id_foreign` (`company_id`), CONSTRAINT `leave_types_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `leaves`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `leaves` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `leave_type_id` int unsigned NOT NULL, `duration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `leave_date` date NOT NULL, `reason` text COLLATE utf8mb4_unicode_ci NOT NULL, `status` enum('approved','pending','rejected') COLLATE utf8mb4_unicode_ci NOT NULL, `reject_reason` text COLLATE utf8mb4_unicode_ci, `paid` tinyint(1) NOT NULL DEFAULT '0', `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `event_id` text COLLATE utf8mb4_unicode_ci, `approved_by` int unsigned DEFAULT NULL, `approved_at` datetime DEFAULT NULL, `half_day_type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `leaves_company_id_foreign` (`company_id`), KEY `leaves_user_id_foreign` (`user_id`), KEY `leaves_leave_type_id_foreign` (`leave_type_id`), KEY `leaves_leave_date_index` (`leave_date`), KEY `leaves_added_by_foreign` (`added_by`), KEY `leaves_last_updated_by_foreign` (`last_updated_by`), KEY `leaves_approved_by_foreign` (`approved_by`), CONSTRAINT `leaves_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `leaves_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `leaves_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `leaves_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `leaves_leave_type_id_foreign` FOREIGN KEY (`leave_type_id`) REFERENCES `leave_types` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `leaves_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `log_time_for`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `log_time_for` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `log_time_for` enum('project','task') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'project', `auto_timer_stop` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `approval_required` tinyint(1) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `log_time_for_company_id_foreign` (`company_id`), CONSTRAINT `log_time_for_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `ltm_translations`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `ltm_translations` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `status` int NOT NULL DEFAULT '0', `locale` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `group` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `key` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `value` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `menu_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `menu_settings` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `main_menu` longtext COLLATE utf8mb4_unicode_ci, `default_main_menu` longtext COLLATE utf8mb4_unicode_ci, `setting_menu` longtext COLLATE utf8mb4_unicode_ci, `default_setting_menu` longtext COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `menus`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `menus` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `menu_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `translate_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `route` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `module` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `icon` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `setting_menu` tinyint(1) DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `message_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `message_settings` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `allow_client_admin` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `allow_client_employee` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `restrict_client` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `message_settings_company_id_foreign` (`company_id`), CONSTRAINT `message_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `migrations`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `migrations` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `batch` int NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `module_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `module_settings` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `module_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `status` enum('active','deactive') COLLATE utf8mb4_unicode_ci NOT NULL, `type` enum('admin','employee','client') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'admin', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `module_settings_company_id_foreign` (`company_id`), CONSTRAINT `module_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `modules`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `modules` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `module_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `notice_views`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `notice_views` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `notice_id` int unsigned NOT NULL, `user_id` int unsigned NOT NULL, `read` tinyint(1) NOT NULL DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `notice_views_company_id_foreign` (`company_id`), KEY `notice_views_notice_id_foreign` (`notice_id`), KEY `notice_views_user_id_foreign` (`user_id`), CONSTRAINT `notice_views_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `notice_views_notice_id_foreign` FOREIGN KEY (`notice_id`) REFERENCES `notices` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `notice_views_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `notices`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `notices` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `to` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'employee', `heading` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` mediumtext COLLATE utf8mb4_unicode_ci, `department_id` int unsigned DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `notices_company_id_foreign` (`company_id`), KEY `notices_department_id_foreign` (`department_id`), KEY `notices_added_by_foreign` (`added_by`), KEY `notices_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `notices_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `notices_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `notices_department_id_foreign` FOREIGN KEY (`department_id`) REFERENCES `teams` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `notices_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `notifications`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `notifications` ( `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL, `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `notifiable_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `notifiable_id` bigint unsigned NOT NULL, `data` text COLLATE utf8mb4_unicode_ci NOT NULL, `read_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `notifications_notifiable_type_notifiable_id_index` (`notifiable_type`,`notifiable_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `offline_payment_methods`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `offline_payment_methods` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` longtext COLLATE utf8mb4_unicode_ci, `status` enum('yes','no') COLLATE utf8mb4_unicode_ci DEFAULT 'yes', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `offline_payment_methods_company_id_foreign` (`company_id`), CONSTRAINT `offline_payment_methods_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `order_item_images`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `order_item_images` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `order_item_id` bigint unsigned DEFAULT NULL, `external_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `order_item_images_order_item_id_index` (`order_item_id`), CONSTRAINT `order_item_images_order_item_id_foreign` FOREIGN KEY (`order_item_id`) REFERENCES `order_items` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `order_items`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `order_items` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `order_id` bigint unsigned NOT NULL, `product_id` int unsigned DEFAULT NULL, `item_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `item_summary` text COLLATE utf8mb4_unicode_ci, `type` enum('item','discount','tax') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'item', `quantity` double(16,2) NOT NULL, `unit_price` int NOT NULL, `amount` double(8,2) NOT NULL, `hsn_sac_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `taxes` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `order_items_order_id_foreign` (`order_id`), KEY `order_items_product_id_foreign` (`product_id`), CONSTRAINT `order_items_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `order_items_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `orders`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `orders` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `client_id` int unsigned DEFAULT NULL, `order_date` date NOT NULL, `sub_total` double(8,2) NOT NULL, `discount` double NOT NULL DEFAULT '0', `discount_type` enum('percent','fixed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'percent', `total` double(8,2) NOT NULL, `status` enum('pending','on-hold','failed','processing','completed','canceled','refunded') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending', `currency_id` int unsigned DEFAULT NULL, `show_shipping_address` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `note` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `company_address_id` bigint unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `orders_company_id_foreign` (`company_id`), KEY `orders_client_id_foreign` (`client_id`), KEY `orders_currency_id_foreign` (`currency_id`), KEY `orders_added_by_foreign` (`added_by`), KEY `orders_last_updated_by_foreign` (`last_updated_by`), KEY `orders_company_address_id_foreign` (`company_address_id`), CONSTRAINT `orders_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `orders_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `orders_company_address_id_foreign` FOREIGN KEY (`company_address_id`) REFERENCES `company_addresses` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `orders_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `orders_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `orders_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `password_resets`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `password_resets` ( `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, KEY `password_resets_email_index` (`email`), KEY `password_resets_token_index` (`token`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `payment_gateway_credentials`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `payment_gateway_credentials` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `paypal_client_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `paypal_secret` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `paypal_status` enum('active','deactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'deactive', `live_stripe_client_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `live_stripe_secret` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `live_stripe_webhook_secret` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `stripe_status` enum('active','deactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'deactive', `live_razorpay_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `live_razorpay_secret` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `razorpay_status` enum('active','inactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'inactive', `paypal_mode` enum('sandbox','live') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'sandbox', `sandbox_paypal_client_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `sandbox_paypal_secret` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `test_stripe_client_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `test_stripe_secret` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `test_razorpay_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `test_razorpay_secret` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `test_stripe_webhook_secret` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `stripe_mode` enum('test','live') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'test', `razorpay_mode` enum('test','live') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'test', `paystack_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `paystack_secret` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `paystack_merchant_email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `paystack_status` enum('active','deactive') COLLATE utf8mb4_unicode_ci DEFAULT 'deactive', `paystack_mode` enum('sandbox','live') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'sandbox', `test_paystack_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `test_paystack_secret` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `test_paystack_merchant_email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `paystack_payment_url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT 'https://api.paystack.co', `mollie_api_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `mollie_status` enum('active','deactive') COLLATE utf8mb4_unicode_ci DEFAULT 'deactive', `payfast_merchant_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `payfast_merchant_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `payfast_passphrase` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `payfast_mode` enum('sandbox','live') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'sandbox', `payfast_status` enum('active','deactive') COLLATE utf8mb4_unicode_ci DEFAULT 'deactive', `authorize_api_login_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `authorize_transaction_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `authorize_environment` enum('sandbox','live') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'sandbox', `authorize_status` enum('active','deactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'deactive', `square_application_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `square_access_token` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `square_location_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `square_environment` enum('sandbox','production') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'sandbox', `square_status` enum('active','deactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'deactive', `flutterwave_status` enum('active','deactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'deactive', `flutterwave_mode` enum('sandbox','live') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'sandbox', `test_flutterwave_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `test_flutterwave_secret` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `test_flutterwave_hash` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `live_flutterwave_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `live_flutterwave_secret` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `live_flutterwave_hash` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `flutterwave_webhook_secret_hash` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `payment_gateway_credentials_company_id_foreign` (`company_id`), CONSTRAINT `payment_gateway_credentials_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `payments`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `payments` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `project_id` int unsigned DEFAULT NULL, `invoice_id` int unsigned DEFAULT NULL, `order_id` bigint unsigned DEFAULT NULL, `credit_notes_id` int unsigned DEFAULT NULL, `amount` double NOT NULL, `gateway` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `transaction_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `currency_id` int unsigned DEFAULT NULL, `plan_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `customer_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `event_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `status` enum('complete','pending','failed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending', `paid_on` datetime DEFAULT NULL, `remarks` text COLLATE utf8mb4_unicode_ci, `offline_method_id` int unsigned DEFAULT NULL, `bill` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `payment_gateway_response` text COLLATE utf8mb4_unicode_ci COMMENT 'null = success', `payload_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `payments_transaction_id_unique` (`transaction_id`), UNIQUE KEY `payments_plan_id_unique` (`plan_id`), UNIQUE KEY `payments_event_id_unique` (`event_id`), KEY `payments_company_id_foreign` (`company_id`), KEY `payments_project_id_foreign` (`project_id`), KEY `payments_invoice_id_foreign` (`invoice_id`), KEY `payments_order_id_foreign` (`order_id`), KEY `payments_credit_notes_id_foreign` (`credit_notes_id`), KEY `payments_currency_id_foreign` (`currency_id`), KEY `payments_paid_on_index` (`paid_on`), KEY `payments_offline_method_id_foreign` (`offline_method_id`), KEY `payments_added_by_foreign` (`added_by`), KEY `payments_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `payments_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `payments_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `payments_credit_notes_id_foreign` FOREIGN KEY (`credit_notes_id`) REFERENCES `credit_notes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `payments_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `payments_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `payments_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `payments_offline_method_id_foreign` FOREIGN KEY (`offline_method_id`) REFERENCES `offline_payment_methods` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `payments_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `payments_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `permission_role`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `permission_role` ( `permission_id` int unsigned NOT NULL, `role_id` int unsigned NOT NULL, `permission_type_id` bigint unsigned NOT NULL DEFAULT '5', PRIMARY KEY (`permission_id`,`role_id`), KEY `permission_role_role_id_foreign` (`role_id`), KEY `permission_role_permission_type_id_foreign` (`permission_type_id`), CONSTRAINT `permission_role_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `permission_role_permission_type_id_foreign` FOREIGN KEY (`permission_type_id`) REFERENCES `permission_types` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `permission_role_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `permission_types`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `permission_types` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `permissions`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `permissions` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `display_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `description` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `module_id` int unsigned NOT NULL, `is_custom` tinyint(1) NOT NULL DEFAULT '0', `allowed_permissions` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `permissions_name_unique` (`name`), KEY `permissions_module_id_foreign` (`module_id`), CONSTRAINT `permissions_module_id_foreign` FOREIGN KEY (`module_id`) REFERENCES `modules` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `pinned`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `pinned` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `project_id` int unsigned DEFAULT NULL, `task_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `pinned_company_id_foreign` (`company_id`), KEY `pinned_project_id_foreign` (`project_id`), KEY `pinned_task_id_foreign` (`task_id`), KEY `pinned_user_id_foreign` (`user_id`), CONSTRAINT `pinned_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `pinned_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `pinned_task_id_foreign` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `pinned_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `product_category`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `product_category` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `category_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `product_files`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `product_files` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `product_id` int unsigned NOT NULL, `filename` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `hashname` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `size` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, PRIMARY KEY (`id`), KEY `product_files_product_id_foreign` (`product_id`), KEY `product_files_added_by_foreign` (`added_by`), KEY `product_files_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `product_files_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `product_files_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `product_files_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `product_sub_category`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `product_sub_category` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `category_id` bigint unsigned NOT NULL, `category_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `product_sub_category_company_id_foreign` (`company_id`), KEY `product_sub_category_category_id_foreign` (`category_id`), CONSTRAINT `product_sub_category_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `product_category` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `product_sub_category_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `products`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `products` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `price` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `taxes` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `allow_purchase` tinyint(1) NOT NULL DEFAULT '0', `downloadable` tinyint(1) NOT NULL DEFAULT '0', `downloadable_file` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `description` text COLLATE utf8mb4_unicode_ci, `category_id` bigint unsigned DEFAULT NULL, `sub_category_id` bigint unsigned DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `hsn_sac_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `default_image` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `products_company_id_foreign` (`company_id`), KEY `products_category_id_foreign` (`category_id`), KEY `products_sub_category_id_foreign` (`sub_category_id`), KEY `products_added_by_foreign` (`added_by`), KEY `products_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `products_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `products_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `product_category` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `products_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `products_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `products_sub_category_id_foreign` FOREIGN KEY (`sub_category_id`) REFERENCES `product_sub_category` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `project_activity`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `project_activity` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `project_id` int unsigned NOT NULL, `activity` text COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `project_activity_project_id_foreign` (`project_id`), KEY `project_activity_created_at_index` (`created_at`), CONSTRAINT `project_activity_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `project_category`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `project_category` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `category_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `project_category_company_id_foreign` (`company_id`), KEY `project_category_added_by_foreign` (`added_by`), KEY `project_category_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `project_category_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_category_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `project_category_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `project_files`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `project_files` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `project_id` int unsigned NOT NULL, `filename` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `hashname` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `description` text COLLATE utf8mb4_unicode_ci, `google_url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `dropbox_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `external_link_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `external_link` text COLLATE utf8mb4_unicode_ci, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `project_files_company_id_foreign` (`company_id`), KEY `project_files_user_id_foreign` (`user_id`), KEY `project_files_project_id_foreign` (`project_id`), KEY `project_files_added_by_foreign` (`added_by`), KEY `project_files_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `project_files_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_files_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `project_files_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_files_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `project_files_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `project_members`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `project_members` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `user_id` int unsigned NOT NULL, `project_id` int unsigned NOT NULL, `hourly_rate` double NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `project_members_user_id_foreign` (`user_id`), KEY `project_members_project_id_foreign` (`project_id`), KEY `project_members_added_by_foreign` (`added_by`), KEY `project_members_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `project_members_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_members_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_members_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `project_members_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `project_milestones`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `project_milestones` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `project_id` int unsigned DEFAULT NULL, `currency_id` int unsigned DEFAULT NULL, `milestone_title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `summary` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL, `cost` double(16,2) NOT NULL, `status` enum('complete','incomplete') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'incomplete', `invoice_created` tinyint(1) NOT NULL, `invoice_id` int DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `start_date` date DEFAULT NULL, `end_date` date DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `project_milestones_project_id_foreign` (`project_id`), KEY `project_milestones_currency_id_foreign` (`currency_id`), KEY `project_milestones_added_by_foreign` (`added_by`), KEY `project_milestones_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `project_milestones_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_milestones_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `project_milestones_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_milestones_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `project_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `project_notes` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `project_id` int unsigned DEFAULT NULL, `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `type` tinyint(1) NOT NULL DEFAULT '0', `client_id` int unsigned DEFAULT NULL, `is_client_show` tinyint(1) NOT NULL DEFAULT '0', `ask_password` tinyint(1) NOT NULL DEFAULT '0', `details` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `project_notes_project_id_foreign` (`project_id`), KEY `project_notes_client_id_foreign` (`client_id`), KEY `project_notes_added_by_foreign` (`added_by`), KEY `project_notes_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `project_notes_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_notes_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `project_notes_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_notes_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `project_ratings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `project_ratings` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `project_id` int unsigned NOT NULL, `rating` double NOT NULL DEFAULT '0', `comment` text COLLATE utf8mb4_unicode_ci, `user_id` int unsigned NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `project_ratings_project_id_foreign` (`project_id`), KEY `project_ratings_user_id_foreign` (`user_id`), KEY `project_ratings_added_by_foreign` (`added_by`), KEY `project_ratings_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `project_ratings_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_ratings_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_ratings_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `project_ratings_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `project_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `project_settings` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `send_reminder` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL, `remind_time` int NOT NULL, `remind_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `remind_to` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '["admins","members"]', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `project_settings_company_id_foreign` (`company_id`), CONSTRAINT `project_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `project_template_members`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `project_template_members` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `user_id` int unsigned NOT NULL, `project_template_id` int unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `project_template_members_user_id_foreign` (`user_id`), KEY `project_template_members_project_template_id_foreign` (`project_template_id`), CONSTRAINT `project_template_members_project_template_id_foreign` FOREIGN KEY (`project_template_id`) REFERENCES `project_templates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `project_template_members_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `project_template_sub_tasks`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `project_template_sub_tasks` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `project_template_task_id` int unsigned NOT NULL, `title` text COLLATE utf8mb4_unicode_ci NOT NULL, `start_date` datetime DEFAULT NULL, `due_date` datetime DEFAULT NULL, `status` enum('incomplete','complete') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'incomplete', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `project_template_sub_tasks_project_template_task_id_foreign` (`project_template_task_id`), CONSTRAINT `project_template_sub_tasks_project_template_task_id_foreign` FOREIGN KEY (`project_template_task_id`) REFERENCES `project_template_tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `project_template_task_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `project_template_task_users` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `project_template_task_id` int unsigned NOT NULL, `user_id` int unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `project_template_task_users_project_template_task_id_foreign` (`project_template_task_id`), KEY `project_template_task_users_user_id_foreign` (`user_id`), CONSTRAINT `project_template_task_users_project_template_task_id_foreign` FOREIGN KEY (`project_template_task_id`) REFERENCES `project_template_tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `project_template_task_users_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `project_template_tasks`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `project_template_tasks` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `heading` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` mediumtext COLLATE utf8mb4_unicode_ci, `project_template_id` int unsigned NOT NULL, `priority` enum('low','medium','high') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'medium', `project_template_task_category_id` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `project_template_tasks_project_template_id_foreign` (`project_template_id`), KEY `project_template_tasks_project_template_task_category_id_foreign` (`project_template_task_category_id`), CONSTRAINT `project_template_tasks_project_template_id_foreign` FOREIGN KEY (`project_template_id`) REFERENCES `project_templates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `project_template_tasks_project_template_task_category_id_foreign` FOREIGN KEY (`project_template_task_category_id`) REFERENCES `task_category` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `project_templates`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `project_templates` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `project_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `category_id` int unsigned DEFAULT NULL, `client_id` int unsigned DEFAULT NULL, `project_summary` mediumtext COLLATE utf8mb4_unicode_ci, `notes` longtext COLLATE utf8mb4_unicode_ci, `feedback` mediumtext COLLATE utf8mb4_unicode_ci, `client_view_task` enum('enable','disable') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'disable', `allow_client_notification` enum('enable','disable') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'disable', `manual_timelog` enum('enable','disable') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'disable', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `project_templates_company_id_foreign` (`company_id`), KEY `project_templates_category_id_foreign` (`category_id`), KEY `project_templates_client_id_foreign` (`client_id`), CONSTRAINT `project_templates_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `project_category` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_templates_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_templates_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `project_time_log_breaks`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `project_time_log_breaks` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `project_time_log_id` int unsigned DEFAULT NULL, `start_time` datetime NOT NULL, `end_time` datetime DEFAULT NULL, `reason` text COLLATE utf8mb4_unicode_ci NOT NULL, `total_hours` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `total_minutes` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `project_time_log_breaks_company_id_foreign` (`company_id`), KEY `project_time_log_breaks_project_time_log_id_foreign` (`project_time_log_id`), KEY `project_time_log_breaks_start_time_index` (`start_time`), KEY `project_time_log_breaks_end_time_index` (`end_time`), KEY `project_time_log_breaks_added_by_foreign` (`added_by`), KEY `project_time_log_breaks_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `project_time_log_breaks_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_time_log_breaks_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `project_time_log_breaks_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_time_log_breaks_project_time_log_id_foreign` FOREIGN KEY (`project_time_log_id`) REFERENCES `project_time_logs` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `project_time_logs`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `project_time_logs` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `project_id` int unsigned DEFAULT NULL, `task_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `start_time` datetime NOT NULL, `end_time` datetime DEFAULT NULL, `memo` text COLLATE utf8mb4_unicode_ci NOT NULL, `total_hours` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `total_minutes` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `edited_by_user` int unsigned DEFAULT NULL, `hourly_rate` int NOT NULL, `earnings` int NOT NULL, `approved` tinyint(1) NOT NULL DEFAULT '1', `approved_by` int unsigned DEFAULT NULL, `invoice_id` int unsigned DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `total_break_minutes` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `project_time_logs_company_id_foreign` (`company_id`), KEY `project_time_logs_project_id_foreign` (`project_id`), KEY `project_time_logs_task_id_foreign` (`task_id`), KEY `project_time_logs_user_id_foreign` (`user_id`), KEY `project_time_logs_start_time_index` (`start_time`), KEY `project_time_logs_end_time_index` (`end_time`), KEY `project_time_logs_edited_by_user_foreign` (`edited_by_user`), KEY `project_time_logs_approved_by_foreign` (`approved_by`), KEY `project_time_logs_invoice_id_foreign` (`invoice_id`), KEY `project_time_logs_added_by_foreign` (`added_by`), KEY `project_time_logs_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `project_time_logs_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_time_logs_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_time_logs_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `project_time_logs_edited_by_user_foreign` FOREIGN KEY (`edited_by_user`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_time_logs_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_time_logs_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `project_time_logs_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `project_time_logs_task_id_foreign` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `project_time_logs_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `project_user_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `project_user_notes` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `user_id` int unsigned NOT NULL, `project_note_id` int unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `project_user_notes_user_id_foreign` (`user_id`), KEY `project_user_notes_project_note_id_foreign` (`project_note_id`), CONSTRAINT `project_user_notes_project_note_id_foreign` FOREIGN KEY (`project_note_id`) REFERENCES `project_notes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `project_user_notes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `projects`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `projects` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `project_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `project_summary` longtext COLLATE utf8mb4_unicode_ci, `project_admin` int unsigned DEFAULT NULL, `start_date` date NOT NULL, `deadline` date DEFAULT NULL, `notes` longtext COLLATE utf8mb4_unicode_ci, `category_id` int unsigned DEFAULT NULL, `client_id` int unsigned DEFAULT NULL, `team_id` int unsigned DEFAULT NULL, `feedback` mediumtext COLLATE utf8mb4_unicode_ci, `manual_timelog` enum('enable','disable') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'disable', `client_view_task` enum('enable','disable') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'disable', `allow_client_notification` enum('enable','disable') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'disable', `completion_percent` tinyint NOT NULL, `calculate_task_progress` enum('true','false') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'true', `project_budget` double(20,2) DEFAULT NULL, `currency_id` int unsigned DEFAULT NULL, `hours_allocated` double(8,2) DEFAULT NULL, `status` enum('not started','in progress','on hold','canceled','finished','under review') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'in progress', `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `hash` text COLLATE utf8mb4_unicode_ci, `public` tinyint(1) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `projects_company_id_foreign` (`company_id`), KEY `projects_project_admin_foreign` (`project_admin`), KEY `projects_category_id_foreign` (`category_id`), KEY `projects_client_id_foreign` (`client_id`), KEY `projects_team_id_foreign` (`team_id`), KEY `projects_currency_id_foreign` (`currency_id`), KEY `projects_added_by_foreign` (`added_by`), KEY `projects_last_updated_by_foreign` (`last_updated_by`), KEY `projects_deleted_at_index` (`deleted_at`), CONSTRAINT `projects_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `projects_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `project_category` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `projects_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `projects_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `projects_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `projects_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `projects_project_admin_foreign` FOREIGN KEY (`project_admin`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `projects_team_id_foreign` FOREIGN KEY (`team_id`) REFERENCES `teams` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `proposal_item_images`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `proposal_item_images` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `proposal_item_id` int unsigned NOT NULL, `filename` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `hashname` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `external_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `proposal_item_images_proposal_item_id_foreign` (`proposal_item_id`), CONSTRAINT `proposal_item_images_proposal_item_id_foreign` FOREIGN KEY (`proposal_item_id`) REFERENCES `proposal_items` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `proposal_items`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `proposal_items` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `proposal_id` int unsigned NOT NULL, `item_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `type` enum('item','discount','tax') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'item', `quantity` double(16,2) NOT NULL, `unit_price` double(16,2) NOT NULL, `amount` double(16,2) NOT NULL, `item_summary` text COLLATE utf8mb4_unicode_ci, `taxes` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `hsn_sac_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `proposal_items_proposal_id_foreign` (`proposal_id`), CONSTRAINT `proposal_items_proposal_id_foreign` FOREIGN KEY (`proposal_id`) REFERENCES `proposals` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `proposal_signs`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `proposal_signs` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `proposal_id` int unsigned NOT NULL, `full_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `signature` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `proposal_signs_proposal_id_foreign` (`proposal_id`), CONSTRAINT `proposal_signs_proposal_id_foreign` FOREIGN KEY (`proposal_id`) REFERENCES `proposals` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `proposals`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `proposals` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `lead_id` int unsigned NOT NULL, `valid_till` date NOT NULL, `sub_total` double(16,2) NOT NULL, `total` double(16,2) NOT NULL, `currency_id` int unsigned DEFAULT NULL, `discount_type` enum('percent','fixed') COLLATE utf8mb4_unicode_ci NOT NULL, `discount` double NOT NULL, `invoice_convert` tinyint(1) NOT NULL DEFAULT '0', `status` enum('declined','accepted','waiting') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'waiting', `note` mediumtext COLLATE utf8mb4_unicode_ci, `description` longtext COLLATE utf8mb4_unicode_ci, `client_comment` text COLLATE utf8mb4_unicode_ci, `signature_approval` tinyint(1) NOT NULL DEFAULT '1', `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `hash` text COLLATE utf8mb4_unicode_ci, `calculate_tax` enum('after_discount','before_discount') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'after_discount', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `proposals_company_id_foreign` (`company_id`), KEY `proposals_lead_id_foreign` (`lead_id`), KEY `proposals_currency_id_foreign` (`currency_id`), KEY `proposals_added_by_foreign` (`added_by`), KEY `proposals_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `proposals_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `proposals_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `proposals_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `proposals_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `proposals_lead_id_foreign` FOREIGN KEY (`lead_id`) REFERENCES `leads` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `purpose_consent`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `purpose_consent` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `purpose_consent_leads`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `purpose_consent_leads` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `lead_id` int unsigned NOT NULL, `purpose_consent_id` int unsigned NOT NULL, `status` enum('agree','disagree') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'agree', `ip` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `updated_by_id` int unsigned DEFAULT NULL, `additional_description` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `purpose_consent_leads_lead_id_foreign` (`lead_id`), KEY `purpose_consent_leads_purpose_consent_id_foreign` (`purpose_consent_id`), KEY `purpose_consent_leads_updated_by_id_foreign` (`updated_by_id`), CONSTRAINT `purpose_consent_leads_lead_id_foreign` FOREIGN KEY (`lead_id`) REFERENCES `leads` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `purpose_consent_leads_purpose_consent_id_foreign` FOREIGN KEY (`purpose_consent_id`) REFERENCES `purpose_consent` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `purpose_consent_leads_updated_by_id_foreign` FOREIGN KEY (`updated_by_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `purpose_consent_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `purpose_consent_users` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `client_id` int unsigned NOT NULL, `purpose_consent_id` int unsigned NOT NULL, `status` enum('agree','disagree') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'agree', `ip` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `updated_by_id` int unsigned NOT NULL, `additional_description` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `purpose_consent_users_client_id_foreign` (`client_id`), KEY `purpose_consent_users_purpose_consent_id_foreign` (`purpose_consent_id`), KEY `purpose_consent_users_updated_by_id_foreign` (`updated_by_id`), CONSTRAINT `purpose_consent_users_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `purpose_consent_users_purpose_consent_id_foreign` FOREIGN KEY (`purpose_consent_id`) REFERENCES `purpose_consent` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `purpose_consent_users_updated_by_id_foreign` FOREIGN KEY (`updated_by_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `push_notification_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `push_notification_settings` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `onesignal_app_id` text COLLATE utf8mb4_unicode_ci, `onesignal_rest_api_key` text COLLATE utf8mb4_unicode_ci, `notification_logo` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `status` enum('active','inactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'inactive', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `push_subscriptions`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `push_subscriptions` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `endpoint` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `public_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `auth_token` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `push_subscriptions_endpoint_unique` (`endpoint`), KEY `push_subscriptions_company_id_foreign` (`company_id`), KEY `push_subscriptions_user_id_index` (`user_id`), CONSTRAINT `push_subscriptions_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `push_subscriptions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `pusher_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `pusher_settings` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `pusher_app_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `pusher_app_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `pusher_app_secret` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `pusher_cluster` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `force_tls` tinyint(1) NOT NULL, `status` tinyint(1) NOT NULL, `taskboard` tinyint(1) NOT NULL DEFAULT '1', `messages` 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; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `quotation_items`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `quotation_items` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `quotation_id` int unsigned NOT NULL, `item_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `quantity` int NOT NULL, `unit_price` int NOT NULL, `amount` double(8,2) NOT NULL, `hsn_sac_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `quotation_items_quotation_id_foreign` (`quotation_id`), CONSTRAINT `quotation_items_quotation_id_foreign` FOREIGN KEY (`quotation_id`) REFERENCES `quotations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `quotations`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `quotations` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `business_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `client_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `client_email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `phone` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `address` text COLLATE utf8mb4_unicode_ci, `sub_total` double(8,2) NOT NULL, `total` double(8,2) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `quotations_company_id_foreign` (`company_id`), CONSTRAINT `quotations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `removal_requests`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `removal_requests` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `user_id` int unsigned DEFAULT NULL, `status` enum('pending','approved','rejected') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `removal_requests_company_id_foreign` (`company_id`), KEY `removal_requests_user_id_foreign` (`user_id`), CONSTRAINT `removal_requests_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `removal_requests_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `removal_requests_lead`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `removal_requests_lead` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `lead_id` int unsigned DEFAULT NULL, `status` enum('pending','approved','rejected') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `removal_requests_lead_company_id_foreign` (`company_id`), KEY `removal_requests_lead_lead_id_foreign` (`lead_id`), CONSTRAINT `removal_requests_lead_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `removal_requests_lead_lead_id_foreign` FOREIGN KEY (`lead_id`) REFERENCES `leads` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `role_user`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `role_user` ( `user_id` int unsigned NOT NULL, `role_id` int unsigned NOT NULL, PRIMARY KEY (`user_id`,`role_id`), KEY `role_user_role_id_foreign` (`role_id`), CONSTRAINT `role_user_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `role_user_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `roles`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `roles` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `display_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `description` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `roles_name_unique` (`name`), KEY `roles_company_id_foreign` (`company_id`), CONSTRAINT `roles_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `sessions`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `sessions` ( `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `user_id` bigint unsigned DEFAULT NULL, `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `user_agent` text COLLATE utf8mb4_unicode_ci, `payload` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL, `last_activity` int NOT NULL, PRIMARY KEY (`id`), KEY `sessions_user_id_index` (`user_id`), KEY `sessions_last_activity_index` (`last_activity`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `skills`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `skills` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `skills_company_id_foreign` (`company_id`), CONSTRAINT `skills_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `slack_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `slack_settings` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `slack_webhook` text COLLATE utf8mb4_unicode_ci, `slack_logo` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `status` enum('active','inactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'inactive', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `slack_settings_company_id_foreign` (`company_id`), CONSTRAINT `slack_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `smtp_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `smtp_settings` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `mail_driver` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'smtp', `mail_host` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'smtp.gmail.com', `mail_port` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '587', `mail_username` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'youremail@gmail.com', `mail_password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'your password', `mail_from_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'your name', `mail_from_email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'from@email.com', `mail_encryption` enum('tls','ssl') COLLATE utf8mb4_unicode_ci DEFAULT 'tls', `verified` tinyint(1) NOT NULL DEFAULT '0', `mail_connection` enum('sync','database') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'sync', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `social_auth_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `social_auth_settings` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `facebook_client_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `facebook_secret_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `facebook_status` enum('enable','disable') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'disable', `google_client_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `google_secret_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `google_status` enum('enable','disable') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'disable', `twitter_client_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `twitter_secret_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `twitter_status` enum('enable','disable') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'disable', `linkedin_client_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `linkedin_secret_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `linkedin_status` enum('enable','disable') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'disable', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `socials`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `socials` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `user_id` int unsigned DEFAULT NULL, `social_id` text COLLATE utf8mb4_unicode_ci NOT NULL, `social_service` text COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `sticky_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `sticky_notes` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `note_text` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL, `colour` enum('blue','yellow','red','gray','purple','green') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'blue', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `sticky_notes_company_id_foreign` (`company_id`), KEY `sticky_notes_user_id_foreign` (`user_id`), CONSTRAINT `sticky_notes_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `sticky_notes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `sub_task_files`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `sub_task_files` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `user_id` int unsigned DEFAULT NULL, `sub_task_id` int unsigned NOT NULL, `filename` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` text COLLATE utf8mb4_unicode_ci, `google_url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `hashname` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `dropbox_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `external_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `external_link_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `sub_task_files_user_id_foreign` (`user_id`), KEY `sub_task_files_sub_task_id_foreign` (`sub_task_id`), CONSTRAINT `sub_task_files_sub_task_id_foreign` FOREIGN KEY (`sub_task_id`) REFERENCES `sub_tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `sub_task_files_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `sub_tasks`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `sub_tasks` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `task_id` int unsigned NOT NULL, `title` text COLLATE utf8mb4_unicode_ci NOT NULL, `due_date` datetime DEFAULT NULL, `start_date` date DEFAULT NULL, `status` enum('incomplete','complete') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'incomplete', `assigned_to` int unsigned DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `description` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `sub_tasks_task_id_foreign` (`task_id`), KEY `sub_tasks_assigned_to_foreign` (`assigned_to`), KEY `sub_tasks_added_by_foreign` (`added_by`), KEY `sub_tasks_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `sub_tasks_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `sub_tasks_assigned_to_foreign` FOREIGN KEY (`assigned_to`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `sub_tasks_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `sub_tasks_task_id_foreign` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `task_category`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `task_category` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `category_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `task_category_company_id_foreign` (`company_id`), KEY `task_category_added_by_foreign` (`added_by`), KEY `task_category_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `task_category_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `task_category_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `task_category_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `task_comments`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `task_comments` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `comment` text COLLATE utf8mb4_unicode_ci NOT NULL, `user_id` int unsigned NOT NULL, `task_id` int unsigned NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `task_comments_user_id_foreign` (`user_id`), KEY `task_comments_task_id_foreign` (`task_id`), KEY `task_comments_added_by_foreign` (`added_by`), KEY `task_comments_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `task_comments_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `task_comments_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `task_comments_task_id_foreign` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `task_comments_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `task_files`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `task_files` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `user_id` int unsigned NOT NULL, `task_id` int unsigned NOT NULL, `filename` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` text COLLATE utf8mb4_unicode_ci, `google_url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `hashname` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `dropbox_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `external_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `external_link_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `task_files_user_id_foreign` (`user_id`), KEY `task_files_task_id_foreign` (`task_id`), KEY `task_files_added_by_foreign` (`added_by`), KEY `task_files_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `task_files_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `task_files_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `task_files_task_id_foreign` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `task_files_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `task_history`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `task_history` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `task_id` int unsigned NOT NULL, `sub_task_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `details` text COLLATE utf8mb4_unicode_ci NOT NULL, `board_column_id` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `task_history_task_id_foreign` (`task_id`), KEY `task_history_sub_task_id_foreign` (`sub_task_id`), KEY `task_history_user_id_foreign` (`user_id`), KEY `task_history_board_column_id_foreign` (`board_column_id`), CONSTRAINT `task_history_board_column_id_foreign` FOREIGN KEY (`board_column_id`) REFERENCES `taskboard_columns` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `task_history_sub_task_id_foreign` FOREIGN KEY (`sub_task_id`) REFERENCES `sub_tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `task_history_task_id_foreign` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `task_history_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `task_label_list`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `task_label_list` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `project_id` int unsigned DEFAULT NULL, `label_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `color` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `description` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `task_label_list_company_id_foreign` (`company_id`), KEY `task_label_list_project_id_foreign` (`project_id`), CONSTRAINT `task_label_list_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `task_label_list_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `task_labels`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `task_labels` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `label_id` int unsigned NOT NULL, `task_id` int unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `task_labels_label_id_foreign` (`label_id`), KEY `task_tags_task_id_foreign` (`task_id`), CONSTRAINT `task_labels_label_id_foreign` FOREIGN KEY (`label_id`) REFERENCES `task_label_list` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `task_tags_task_id_foreign` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `task_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `task_notes` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `task_id` int unsigned NOT NULL, `user_id` int DEFAULT NULL, `note` text COLLATE utf8mb4_unicode_ci, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `task_notes_task_id_foreign` (`task_id`), KEY `task_notes_added_by_foreign` (`added_by`), KEY `task_notes_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `task_notes_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `task_notes_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `task_notes_task_id_foreign` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `task_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `task_users` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `task_id` int unsigned NOT NULL, `user_id` int unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `task_users_task_id_foreign` (`task_id`), KEY `task_users_user_id_foreign` (`user_id`), CONSTRAINT `task_users_task_id_foreign` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `task_users_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `taskboard_columns`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `taskboard_columns` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `column_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `slug` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `label_color` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `priority` int NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `taskboard_columns_column_name_unique` (`column_name`), KEY `taskboard_columns_company_id_foreign` (`company_id`), CONSTRAINT `taskboard_columns_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `tasks`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `tasks` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `heading` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` longtext COLLATE utf8mb4_unicode_ci, `due_date` date DEFAULT NULL, `start_date` date DEFAULT NULL, `project_id` int unsigned DEFAULT NULL, `task_category_id` int unsigned DEFAULT NULL, `priority` enum('low','medium','high') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'medium', `status` enum('incomplete','completed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'incomplete', `board_column_id` int unsigned DEFAULT '1', `column_priority` int NOT NULL, `completed_on` datetime DEFAULT NULL, `created_by` int unsigned DEFAULT NULL, `recurring_task_id` int unsigned DEFAULT NULL, `dependent_task_id` int unsigned DEFAULT NULL, `milestone_id` int unsigned DEFAULT NULL, `is_private` tinyint(1) NOT NULL DEFAULT '0', `billable` tinyint(1) NOT NULL DEFAULT '1', `estimate_hours` int NOT NULL, `estimate_minutes` int NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `hash` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `repeat` tinyint(1) NOT NULL DEFAULT '0', `repeat_complete` tinyint(1) NOT NULL DEFAULT '0', `repeat_count` int DEFAULT NULL, `repeat_type` enum('day','week','month','year') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'day', `repeat_cycles` int DEFAULT NULL, `event_id` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `tasks_company_id_foreign` (`company_id`), KEY `tasks_due_date_index` (`due_date`), KEY `tasks_project_id_foreign` (`project_id`), KEY `tasks_task_category_id_foreign` (`task_category_id`), KEY `tasks_board_column_id_foreign` (`board_column_id`), KEY `tasks_created_by_foreign` (`created_by`), KEY `tasks_recurring_task_id_foreign` (`recurring_task_id`), KEY `tasks_dependent_task_id_foreign` (`dependent_task_id`), KEY `tasks_milestone_id_foreign` (`milestone_id`), KEY `tasks_added_by_foreign` (`added_by`), KEY `tasks_last_updated_by_foreign` (`last_updated_by`), KEY `tasks_deleted_at_index` (`deleted_at`), CONSTRAINT `tasks_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `tasks_board_column_id_foreign` FOREIGN KEY (`board_column_id`) REFERENCES `taskboard_columns` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `tasks_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `tasks_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `tasks_dependent_task_id_foreign` FOREIGN KEY (`dependent_task_id`) REFERENCES `tasks` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `tasks_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `tasks_milestone_id_foreign` FOREIGN KEY (`milestone_id`) REFERENCES `project_milestones` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `tasks_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `tasks_recurring_task_id_foreign` FOREIGN KEY (`recurring_task_id`) REFERENCES `tasks` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `tasks_task_category_id_foreign` FOREIGN KEY (`task_category_id`) REFERENCES `task_category` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `taxes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `taxes` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `tax_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `rate_percent` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `taxes_company_id_foreign` (`company_id`), CONSTRAINT `taxes_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `teams`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `teams` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `team_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `teams_company_id_foreign` (`company_id`), KEY `teams_added_by_foreign` (`added_by`), KEY `teams_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `teams_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `teams_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `teams_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `theme_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `theme_settings` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `panel` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `header_color` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `sidebar_color` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `sidebar_text_color` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `link_color` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#ffffff', `user_css` longtext COLLATE utf8mb4_unicode_ci, `sidebar_theme` enum('dark','light') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'dark', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `theme_settings_company_id_foreign` (`company_id`), CONSTRAINT `theme_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `ticket_agent_groups`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `ticket_agent_groups` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `agent_id` int unsigned NOT NULL, `group_id` int unsigned DEFAULT NULL, `status` enum('enabled','disabled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'enabled', `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `ticket_agent_groups_company_id_foreign` (`company_id`), KEY `ticket_agent_groups_agent_id_foreign` (`agent_id`), KEY `ticket_agent_groups_group_id_foreign` (`group_id`), KEY `ticket_agent_groups_added_by_foreign` (`added_by`), KEY `ticket_agent_groups_last_updated_by_foreign` (`last_updated_by`), CONSTRAINT `ticket_agent_groups_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `ticket_agent_groups_agent_id_foreign` FOREIGN KEY (`agent_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `ticket_agent_groups_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `ticket_agent_groups_group_id_foreign` FOREIGN KEY (`group_id`) REFERENCES `ticket_groups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `ticket_agent_groups_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `ticket_channels`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `ticket_channels` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `channel_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `ticket_channels_channel_name_unique` (`channel_name`), KEY `ticket_channels_company_id_foreign` (`company_id`), CONSTRAINT `ticket_channels_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `ticket_custom_forms`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `ticket_custom_forms` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `custom_fields_id` int unsigned DEFAULT NULL, `field_display_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `field_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `field_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'text', `field_order` int NOT NULL, `status` enum('active','inactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active', `required` tinyint(1) NOT NULL DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `ticket_custom_forms_company_id_foreign` (`company_id`), KEY `ticket_custom_forms_custom_fields_id_foreign` (`custom_fields_id`), CONSTRAINT `ticket_custom_forms_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `ticket_custom_forms_custom_fields_id_foreign` FOREIGN KEY (`custom_fields_id`) REFERENCES `custom_fields` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `ticket_email_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `ticket_email_settings` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `mail_username` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `mail_password` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `mail_from_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `mail_from_email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `imap_host` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `imap_port` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `imap_encryption` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `status` tinyint(1) NOT NULL, `verified` tinyint(1) NOT NULL, `sync_interval` int NOT NULL DEFAULT '1', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `ticket_email_settings_company_id_foreign` (`company_id`), CONSTRAINT `ticket_email_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `ticket_files`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `ticket_files` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `user_id` int unsigned NOT NULL, `ticket_reply_id` int unsigned NOT NULL, `filename` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` text COLLATE utf8mb4_unicode_ci, `google_url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `hashname` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `dropbox_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `external_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `external_link_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `ticket_files_user_id_foreign` (`user_id`), KEY `ticket_files_ticket_reply_id_foreign` (`ticket_reply_id`), CONSTRAINT `ticket_files_ticket_reply_id_foreign` FOREIGN KEY (`ticket_reply_id`) REFERENCES `ticket_replies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `ticket_files_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `ticket_groups`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `ticket_groups` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `group_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `ticket_groups_company_id_foreign` (`company_id`), CONSTRAINT `ticket_groups_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `ticket_replies`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `ticket_replies` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `ticket_id` int unsigned NOT NULL, `user_id` int unsigned NOT NULL, `message` mediumtext COLLATE utf8mb4_unicode_ci, `deleted_at` timestamp NULL DEFAULT NULL, `imap_message_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `imap_message_uid` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `imap_in_reply_to` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `ticket_replies_ticket_id_foreign` (`ticket_id`), KEY `ticket_replies_user_id_foreign` (`user_id`), CONSTRAINT `ticket_replies_ticket_id_foreign` FOREIGN KEY (`ticket_id`) REFERENCES `tickets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `ticket_replies_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `ticket_reply_templates`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `ticket_reply_templates` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `reply_heading` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL, `reply_text` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `ticket_reply_templates_company_id_foreign` (`company_id`), CONSTRAINT `ticket_reply_templates_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `ticket_tag_list`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `ticket_tag_list` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `tag_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `ticket_tag_list_company_id_foreign` (`company_id`), CONSTRAINT `ticket_tag_list_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `ticket_tags`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `ticket_tags` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `tag_id` int unsigned NOT NULL, `ticket_id` int unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `ticket_tags_company_id_foreign` (`company_id`), KEY `ticket_tags_tag_id_foreign` (`tag_id`), KEY `ticket_tags_ticket_id_foreign` (`ticket_id`), CONSTRAINT `ticket_tags_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `ticket_tags_tag_id_foreign` FOREIGN KEY (`tag_id`) REFERENCES `ticket_tag_list` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `ticket_tags_ticket_id_foreign` FOREIGN KEY (`ticket_id`) REFERENCES `tickets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `ticket_types`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `ticket_types` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `ticket_types_type_unique` (`type`), KEY `ticket_types_company_id_foreign` (`company_id`), CONSTRAINT `ticket_types_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `tickets`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `tickets` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `subject` text COLLATE utf8mb4_unicode_ci NOT NULL, `status` enum('open','pending','resolved','closed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'open', `priority` enum('low','medium','high','urgent') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'medium', `agent_id` int unsigned DEFAULT NULL, `channel_id` int unsigned DEFAULT NULL, `type_id` int unsigned DEFAULT NULL, `close_date` date DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, `mobile` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `country_id` int unsigned DEFAULT NULL, `added_by` int unsigned DEFAULT NULL, `last_updated_by` int unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `tickets_company_id_foreign` (`company_id`), KEY `tickets_user_id_foreign` (`user_id`), KEY `tickets_agent_id_foreign` (`agent_id`), KEY `tickets_channel_id_foreign` (`channel_id`), KEY `tickets_type_id_foreign` (`type_id`), KEY `tickets_country_id_foreign` (`country_id`), KEY `tickets_added_by_foreign` (`added_by`), KEY `tickets_last_updated_by_foreign` (`last_updated_by`), KEY `tickets_updated_at_index` (`updated_at`), CONSTRAINT `tickets_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `tickets_agent_id_foreign` FOREIGN KEY (`agent_id`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `tickets_channel_id_foreign` FOREIGN KEY (`channel_id`) REFERENCES `ticket_channels` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `tickets_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `tickets_country_id_foreign` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `tickets_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `tickets_type_id_foreign` FOREIGN KEY (`type_id`) REFERENCES `ticket_types` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `tickets_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `translate_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `translate_settings` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `google_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `universal_search`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `universal_search` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `searchable_id` int NOT NULL, `module_type` enum('ticket','invoice','notice','proposal','task','creditNote','client','employee','project','estimate','lead') COLLATE utf8mb4_unicode_ci DEFAULT NULL, `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `route_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `universal_search_company_id_foreign` (`company_id`), CONSTRAINT `universal_search_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `user_activities`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `user_activities` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `activity` text COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `user_activities_company_id_foreign` (`company_id`), KEY `user_activities_user_id_foreign` (`user_id`), KEY `user_activities_created_at_index` (`created_at`), CONSTRAINT `user_activities_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `user_activities_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `user_invitations`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `user_invitations` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `invitation_type` enum('email','link') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'email', `email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `invitation_code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `status` enum('active','inactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active', `email_restriction` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `message` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `user_invitations_company_id_foreign` (`company_id`), KEY `user_invitations_user_id_foreign` (`user_id`), CONSTRAINT `user_invitations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `user_invitations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `user_leadboard_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `user_leadboard_settings` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `board_column_id` int unsigned NOT NULL, `collapsed` tinyint(1) NOT NULL DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `user_leadboard_settings_company_id_foreign` (`company_id`), KEY `user_leadboard_settings_user_id_foreign` (`user_id`), KEY `user_leadboard_settings_board_column_id_foreign` (`board_column_id`), CONSTRAINT `user_leadboard_settings_board_column_id_foreign` FOREIGN KEY (`board_column_id`) REFERENCES `lead_status` (`id`) ON UPDATE CASCADE, CONSTRAINT `user_leadboard_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `user_leadboard_settings_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `user_permissions`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `user_permissions` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `user_id` int unsigned NOT NULL, `permission_id` int unsigned NOT NULL, `permission_type_id` bigint unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `user_permissions_user_id_foreign` (`user_id`), KEY `user_permissions_permission_id_foreign` (`permission_id`), KEY `user_permissions_permission_type_id_foreign` (`permission_type_id`), CONSTRAINT `user_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `user_permissions_permission_type_id_foreign` FOREIGN KEY (`permission_type_id`) REFERENCES `permission_types` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `user_permissions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `user_taskboard_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `user_taskboard_settings` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `board_column_id` int unsigned NOT NULL, `collapsed` tinyint(1) NOT NULL DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `user_taskboard_settings_company_id_foreign` (`company_id`), KEY `user_taskboard_settings_user_id_foreign` (`user_id`), KEY `user_taskboard_settings_board_column_id_foreign` (`board_column_id`), CONSTRAINT `user_taskboard_settings_board_column_id_foreign` FOREIGN KEY (`board_column_id`) REFERENCES `taskboard_columns` (`id`) ON UPDATE CASCADE, CONSTRAINT `user_taskboard_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `user_taskboard_settings_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `users` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `two_factor_secret` text COLLATE utf8mb4_unicode_ci, `two_factor_recovery_codes` text COLLATE utf8mb4_unicode_ci, `two_factor_confirmed` tinyint(1) NOT NULL DEFAULT '0', `two_factor_email_confirmed` tinyint(1) NOT NULL DEFAULT '0', `image` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `mobile` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `gender` enum('male','female','others') COLLATE utf8mb4_unicode_ci DEFAULT NULL, `salutation` enum('mr','mrs','miss','dr','sir','madam') COLLATE utf8mb4_unicode_ci DEFAULT NULL, `locale` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'en', `status` enum('active','deactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active', `login` enum('enable','disable') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'enable', `onesignal_player_id` text COLLATE utf8mb4_unicode_ci, `last_login` timestamp NULL DEFAULT NULL, `email_notifications` tinyint(1) NOT NULL DEFAULT '1', `country_id` int unsigned DEFAULT NULL, `dark_theme` tinyint(1) NOT NULL, `rtl` tinyint(1) NOT NULL, `two_fa_verify_via` enum('email','google_authenticator','both') COLLATE utf8mb4_unicode_ci DEFAULT NULL, `two_factor_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'when authenticator is email', `two_factor_expires_at` datetime DEFAULT NULL, `admin_approval` tinyint(1) NOT NULL DEFAULT '1', `permission_sync` tinyint(1) NOT NULL DEFAULT '1', `google_calendar_status` tinyint(1) NOT NULL DEFAULT '1', `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `users_email_unique` (`email`), KEY `users_country_id_foreign` (`country_id`), KEY `users_company_id_foreign` (`company_id`), CONSTRAINT `users_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `users_country_id_foreign` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `users_chat`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `users_chat` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_one` int unsigned NOT NULL, `user_id` int unsigned NOT NULL, `message` mediumtext COLLATE utf8mb4_unicode_ci, `from` int unsigned DEFAULT NULL, `to` int unsigned DEFAULT NULL, `message_seen` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `users_chat_company_id_foreign` (`company_id`), KEY `users_chat_user_one_foreign` (`user_one`), KEY `users_chat_user_id_foreign` (`user_id`), KEY `users_chat_from_foreign` (`from`), KEY `users_chat_to_foreign` (`to`), CONSTRAINT `users_chat_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `users_chat_from_foreign` FOREIGN KEY (`from`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `users_chat_to_foreign` FOREIGN KEY (`to`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `users_chat_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `users_chat_user_one_foreign` FOREIGN KEY (`user_one`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `users_chat_files`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `users_chat_files` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `company_id` int unsigned DEFAULT NULL, `user_id` int unsigned NOT NULL, `users_chat_id` int unsigned NOT NULL, `filename` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` text COLLATE utf8mb4_unicode_ci, `google_url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `hashname` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `external_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `external_link_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `users_chat_files_company_id_foreign` (`company_id`), KEY `users_chat_files_user_id_foreign` (`user_id`), KEY `users_chat_files_users_chat_id_foreign` (`users_chat_id`), CONSTRAINT `users_chat_files_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `users_chat_files_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `users_chat_files_users_chat_id_foreign` FOREIGN KEY (`users_chat_id`) REFERENCES `users_chat` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; INSERT INTO `migrations` VALUES (1,'2014_04_02_193005_create_translations_table',1); INSERT INTO `migrations` VALUES (2,'2014_10_12_000000_create_users_table',1); INSERT INTO `migrations` VALUES (3,'2014_10_12_100000_create_password_resets_table',1); INSERT INTO `migrations` VALUES (4,'2016_06_20_112951_create_user_chat_table',1); INSERT INTO `migrations` VALUES (5,'2017_03_23_110416_add_column_users_table',1); INSERT INTO `migrations` VALUES (6,'2017_03_23_111036_create_client_details_table',1); INSERT INTO `migrations` VALUES (7,'2017_03_23_112028_create_client_contacts_table',1); INSERT INTO `migrations` VALUES (8,'2017_03_23_112353_create_employee_details_table',1); INSERT INTO `migrations` VALUES (9,'2017_03_23_114438_create_organisation_settings_table',1); INSERT INTO `migrations` VALUES (10,'2017_03_23_122646_create_project_category_table',1); INSERT INTO `migrations` VALUES (11,'2017_03_23_123601_create_projects_table',1); INSERT INTO `migrations` VALUES (12,'2017_03_23_125424_create_project_members_table',1); INSERT INTO `migrations` VALUES (13,'2017_03_23_125625_create_project_time_logs_table',1); INSERT INTO `migrations` VALUES (14,'2017_03_23_130413_create_project_files_table',1); INSERT INTO `migrations` VALUES (15,'2017_03_24_051800_create_tasks_table',1); INSERT INTO `migrations` VALUES (16,'2017_03_24_054355_create_notices_table',1); INSERT INTO `migrations` VALUES (17,'2017_03_24_055005_create_conversation_table',1); INSERT INTO `migrations` VALUES (18,'2017_03_24_055539_create_conversation_reply_table',1); INSERT INTO `migrations` VALUES (19,'2017_03_24_055859_create_invoices_table',1); INSERT INTO `migrations` VALUES (20,'2017_03_24_060421_create_invoice_items_table',1); INSERT INTO `migrations` VALUES (21,'2017_03_24_060751_create_quotations_table',1); INSERT INTO `migrations` VALUES (22,'2017_03_24_061241_create_quotation_items_table',1); INSERT INTO `migrations` VALUES (23,'2017_03_24_061505_create_sticky_notes_table',1); INSERT INTO `migrations` VALUES (24,'2017_03_24_064541_create_issues_table',1); INSERT INTO `migrations` VALUES (25,'2017_03_29_123858_entrust_setup_tables',1); INSERT INTO `migrations` VALUES (26,'2017_04_04_193158_AddColumnsProjectFilesTable',1); INSERT INTO `migrations` VALUES (27,'2017_04_05_063103_change_clientid_projectid_invoice_table',1); INSERT INTO `migrations` VALUES (28,'2017_04_06_051401_add_discount_column_invoice_table',1); INSERT INTO `migrations` VALUES (29,'2017_04_06_054728_add_status_column_issues_table',1); INSERT INTO `migrations` VALUES (30,'2017_04_08_152902_add_total_hours_column_time_log_table',1); INSERT INTO `migrations` VALUES (31,'2017_04_18_095809_create_project_activity_table',1); INSERT INTO `migrations` VALUES (32,'2017_04_18_103815_create_user_activities_table',1); INSERT INTO `migrations` VALUES (33,'2017_04_19_101519_create_email_notification_settings_table',1); INSERT INTO `migrations` VALUES (34,'2017_04_20_185211_add_colour_column_sticky_notes_table',1); INSERT INTO `migrations` VALUES (35,'2017_04_28_114154_create_notifications_table',1); INSERT INTO `migrations` VALUES (36,'2017_05_03_131016_add_project_completion_field_projects',1); INSERT INTO `migrations` VALUES (37,'2017_05_03_174333_create_currencies_table',1); INSERT INTO `migrations` VALUES (38,'2017_05_05_124330_create_module_settings_table',1); INSERT INTO `migrations` VALUES (39,'2017_05_05_233111_add_status_column_invoices',1); INSERT INTO `migrations` VALUES (40,'2017_05_11_140502_add_currency_symbol_column_invoices',1); INSERT INTO `migrations` VALUES (41,'2017_05_11_170244_add_currency_id_column_organisation_settings_table',1); INSERT INTO `migrations` VALUES (42,'2017_05_22_172748_add_timezone_column_settings_table',1); INSERT INTO `migrations` VALUES (43,'2017_05_24_120216_create_smtp_settings_table',1); INSERT INTO `migrations` VALUES (44,'2017_05_31_112158_create_universal_search_table',1); INSERT INTO `migrations` VALUES (45,'2017_06_22_131112_add_locale_organisation_settings_table',1); INSERT INTO `migrations` VALUES (46,'2017_07_13_091922_add_calculate_task_progress_column_project_table',1); INSERT INTO `migrations` VALUES (47,'2017_07_20_093528_on_delete_setnull_timelog',1); INSERT INTO `migrations` VALUES (48,'2017_07_21_120958_create_theme_settings_table',1); INSERT INTO `migrations` VALUES (49,'2017_07_24_113657_add_link_color_column_theme_settings_table',1); INSERT INTO `migrations` VALUES (50,'2017_07_24_123050_add_login_background_organisation_settings_table',1); INSERT INTO `migrations` VALUES (51,'2017_07_27_101351_add_column_type_invoice_items_table',1); INSERT INTO `migrations` VALUES (52,'2017_07_28_102010_create_estimates_table',1); INSERT INTO `migrations` VALUES (53,'2017_07_28_103230_create_estimate_items_table',1); INSERT INTO `migrations` VALUES (54,'2017_08_04_064431_create_payments_table',1); INSERT INTO `migrations` VALUES (55,'2017_08_05_103940_create_payment_gateway_credential_table',1); INSERT INTO `migrations` VALUES (56,'2017_08_08_055908_add_enable_paypal_column_payment_gateway_table',1); INSERT INTO `migrations` VALUES (57,'2017_08_09_054230_create_expenses_table',1); INSERT INTO `migrations` VALUES (58,'2017_08_21_065430_add_exchange_rate_column_currency_table',1); INSERT INTO `migrations` VALUES (59,'2017_08_21_131318_create_invoice_setting_table',1); INSERT INTO `migrations` VALUES (60,'2017_08_22_055908_add_expense_email_setting_to_email_notification_setting_table',1); INSERT INTO `migrations` VALUES (61,'2017_08_28_110759_add_recurring_columns_in_invoice_table',1); INSERT INTO `migrations` VALUES (62,'2017_08_30_061016_add_plan_id_to_payments_table',1); INSERT INTO `migrations` VALUES (63,'2017_08_30_093400_create_settings_table',1); INSERT INTO `migrations` VALUES (64,'2017_08_30_123956_add_slack_username_column_employee_details_table',1); INSERT INTO `migrations` VALUES (65,'2017_08_30_133725_add_send_slack_column_email_notification_settings_table',1); INSERT INTO `migrations` VALUES (66,'2017_09_01_060715_add_stipe_column_to_payment_credentials_table',1); INSERT INTO `migrations` VALUES (67,'2017_09_01_090124_add_customer_id_column_to_payments_table',1); INSERT INTO `migrations` VALUES (68,'2017_09_02_084049_add_locale_column_users_table',1); INSERT INTO `migrations` VALUES (69,'2017_09_14_095429_create_ticket_reply_templates_table',1); INSERT INTO `migrations` VALUES (70,'2017_09_14_095815_create_ticket_types_table',1); INSERT INTO `migrations` VALUES (71,'2017_09_14_100400_create_ticket_groups_table',1); INSERT INTO `migrations` VALUES (72,'2017_09_14_100530_create_ticket_tag_list_table',1); INSERT INTO `migrations` VALUES (73,'2017_09_14_114900_create_ticket_channels_table',1); INSERT INTO `migrations` VALUES (74,'2017_09_14_115003_create_ticket_agent_groups_table',1); INSERT INTO `migrations` VALUES (75,'2017_09_14_115004_create_tickets_table',1); INSERT INTO `migrations` VALUES (76,'2017_09_14_115005_create_ticket_tags_table',1); INSERT INTO `migrations` VALUES (77,'2017_09_18_064917_add_status_column_ticket_agent_group_table',1); INSERT INTO `migrations` VALUES (78,'2017_09_24_101700_create_ticket_replies_table',1); INSERT INTO `migrations` VALUES (79,'2017_09_25_060229_drop_description_column_ticket_table',1); INSERT INTO `migrations` VALUES (80,'2017_09_25_072611_add_deleted_at_column_tickets',1); INSERT INTO `migrations` VALUES (81,'2017_09_25_072627_add_deleted_at_column_ticket_reply',1); INSERT INTO `migrations` VALUES (82,'2017_10_03_094922_ticket_notification_migration',1); INSERT INTO `migrations` VALUES (83,'2017_10_03_134003_add_latitude_longitude_column',1); INSERT INTO `migrations` VALUES (84,'2017_10_12_111741_create_attendance_setting_table',1); INSERT INTO `migrations` VALUES (85,'2017_10_13_051909_create_attendance_table',1); INSERT INTO `migrations` VALUES (86,'2017_10_26_051335_add_mail_from_email_column_smtp_settings_table',1); INSERT INTO `migrations` VALUES (87,'2017_10_26_112253_add_office_open_days_column_attendance_settings_table',1); INSERT INTO `migrations` VALUES (88,'2017_11_01_054603_add_columns_to_client_details',1); INSERT INTO `migrations` VALUES (89,'2017_11_02_045542_change_on_cascade_project_members',1); INSERT INTO `migrations` VALUES (90,'2017_11_07_054438_add_project_admin_column_project_table',1); INSERT INTO `migrations` VALUES (91,'2017_11_07_125619_remove_project_admin_role',1); INSERT INTO `migrations` VALUES (92,'2017_11_08_045549_make_project_id_nullable_tasks_table',1); INSERT INTO `migrations` VALUES (93,'2017_11_09_071318_create_taskboard_columns_table',1); INSERT INTO `migrations` VALUES (94,'2017_11_09_092817_add_column_tasks_table',1); INSERT INTO `migrations` VALUES (95,'2017_11_20_070830_create_custom_fields_table',1); INSERT INTO `migrations` VALUES (96,'2017_11_20_071758_create_custom_fields__data_table',1); INSERT INTO `migrations` VALUES (97,'2017_11_22_071535_create_events_table',1); INSERT INTO `migrations` VALUES (98,'2017_11_23_065323_add_cryptocurrency_columns',1); INSERT INTO `migrations` VALUES (99,'2017_11_24_103957_create_event_attendees_table',1); INSERT INTO `migrations` VALUES (100,'2017_12_07_034433_change cascade users in time log table',1); INSERT INTO `migrations` VALUES (101,'2017_12_12_071823_create_modules_table',1); INSERT INTO `migrations` VALUES (102,'2017_12_12_073501_add_module_id_column_permissions_table',1); INSERT INTO `migrations` VALUES (103,'2017_12_21_114839_change_upload_folder',1); INSERT INTO `migrations` VALUES (104,'2017_12_28_112910_create_leave_types_table',1); INSERT INTO `migrations` VALUES (105,'2017_12_30_184422_create_leaves_table',1); INSERT INTO `migrations` VALUES (106,'2018_01_02_122442_add_leaves_notification_setting',1); INSERT INTO `migrations` VALUES (107,'2018_01_05_062543_add_user_css_column_theme_settings',1); INSERT INTO `migrations` VALUES (108,'2018_01_09_180937_add_task_completed_notification_setting',1); INSERT INTO `migrations` VALUES (109,'2018_01_29_073527_create_message_setting_table',1); INSERT INTO `migrations` VALUES (110,'2018_04_12_100452_add_dropbox_link_column_project_files_table',1); INSERT INTO `migrations` VALUES (111,'2018_04_12_123243_create_file_storage_table',1); INSERT INTO `migrations` VALUES (112,'2018_04_13_072732_create_groups_table',1); INSERT INTO `migrations` VALUES (113,'2018_04_13_092757_create_employee_groups_table',1); INSERT INTO `migrations` VALUES (114,'2018_04_17_113657_set_attendance_late_column_default',1); INSERT INTO `migrations` VALUES (115,'2018_05_07_065407_alter_invoice_id_null_payments',1); INSERT INTO `migrations` VALUES (116,'2018_05_07_065557_add_currency_id_column_payments_table',1); INSERT INTO `migrations` VALUES (117,'2018_05_08_064539_add_note_column_invoices',1); INSERT INTO `migrations` VALUES (118,'2018_05_15_072536_add_project_id_column_payments',1); INSERT INTO `migrations` VALUES (119,'2018_05_28_094515_set_gateway_column_null_payments_table',1); INSERT INTO `migrations` VALUES (120,'2018_05_29_070343_change_completed_on_column_to_datetime',1); INSERT INTO `migrations` VALUES (121,'2018_05_29_114402_populate_file_storage_settings_table',1); INSERT INTO `migrations` VALUES (122,'2018_05_30_051128_add_google_url_to_project_files_table',1); INSERT INTO `migrations` VALUES (123,'2018_06_05_092136_create_sub_tasks_table',1); INSERT INTO `migrations` VALUES (124,'2018_06_06_091511_create_task_comments_table',1); INSERT INTO `migrations` VALUES (125,'2018_06_11_054204_create_push_subscriptions_table',1); INSERT INTO `migrations` VALUES (126,'2018_06_14_094059_create_taxes_table',1); INSERT INTO `migrations` VALUES (127,'2018_06_18_065034_add_tax_id_column_invoice_items_table',1); INSERT INTO `migrations` VALUES (128,'2018_06_18_071442_add_discount_column_invoice_items_table',1); INSERT INTO `migrations` VALUES (129,'2018_06_21_052408_change_default_taskboard_columns',1); INSERT INTO `migrations` VALUES (130,'2018_06_26_160023_add_leave_count_column_leave_types_table',1); INSERT INTO `migrations` VALUES (131,'2018_06_27_072813_add_leaves_start_from_column',1); INSERT INTO `migrations` VALUES (132,'2018_06_27_075233_add_joining_date_column',1); INSERT INTO `migrations` VALUES (133,'2018_06_27_113713_add_gender_column_users_table',1); INSERT INTO `migrations` VALUES (134,'2018_06_28_054604_add_client_view_task_column_project_table',1); INSERT INTO `migrations` VALUES (135,'2018_06_28_191256_create_language_settings_table',1); INSERT INTO `migrations` VALUES (136,'2018_06_29_060331_add_active_theme_column_settings',1); INSERT INTO `migrations` VALUES (137,'2018_06_29_081128_add_manual_timelog_column_project_timelog',1); INSERT INTO `migrations` VALUES (138,'2018_06_29_104709_seed_languages',1); INSERT INTO `migrations` VALUES (139,'2018_08_02_121259_add_minutes_column_time_log_table',1); INSERT INTO `migrations` VALUES (140,'2018_08_22_103829_add_leaves_module',1); INSERT INTO `migrations` VALUES (141,'2018_08_22_104302_add_leaves_permissions',1); INSERT INTO `migrations` VALUES (142,'2018_08_27_114329_add_module_list_in_module_settings',1); INSERT INTO `migrations` VALUES (143,'2018_08_30_065158_add_status_column_users_table',1); INSERT INTO `migrations` VALUES (144,'2018_08_31_095814_create_lead_table',1); INSERT INTO `migrations` VALUES (145,'2018_08_31_095815_create_lead_source_table',1); INSERT INTO `migrations` VALUES (146,'2018_08_31_095815_create_lead_status_table',1); INSERT INTO `migrations` VALUES (147,'2018_08_31_095816_create_lead_follow_up_table',1); INSERT INTO `migrations` VALUES (148,'2018_09_04_095158_alter_lead_table',1); INSERT INTO `migrations` VALUES (149,'2018_09_04_095816_add_lead_module',1); INSERT INTO `migrations` VALUES (150,'2018_09_05_102010_create_proposal_table',1); INSERT INTO `migrations` VALUES (151,'2018_09_05_113230_create_proposal_items_table',1); INSERT INTO `migrations` VALUES (152,'2018_09_07_051239_alter_lead_website_table',1); INSERT INTO `migrations` VALUES (153,'2018_09_15_174026_add_default_lead_settings',1); INSERT INTO `migrations` VALUES (154,'2018_09_17_045718_add_leads_permission',1); INSERT INTO `migrations` VALUES (155,'2018_09_19_091643_add_remarks_to_payments_table',1); INSERT INTO `migrations` VALUES (156,'2018_09_19_100708_create_products_table',1); INSERT INTO `migrations` VALUES (157,'2018_09_21_095816_create_offline_payment_method_table',1); INSERT INTO `migrations` VALUES (158,'2018_09_25_065158_alter_payment_table',1); INSERT INTO `migrations` VALUES (159,'2018_09_28_110029_create_log_time_for_table',1); INSERT INTO `migrations` VALUES (160,'2018_09_28_965158_alter_project_time_log_table',1); INSERT INTO `migrations` VALUES (161,'2018_10_08_091643_alter_project_table',1); INSERT INTO `migrations` VALUES (162,'2018_10_08_110029_create_lead_files_table',1); INSERT INTO `migrations` VALUES (163,'2018_10_10_110029_create_holidays_table',1); INSERT INTO `migrations` VALUES (164,'2018_10_10_123601_create_project_templates_table',1); INSERT INTO `migrations` VALUES (165,'2018_10_10_125424_create_project_template_members_table',1); INSERT INTO `migrations` VALUES (166,'2018_10_10_135816_add_holiday_module',1); INSERT INTO `migrations` VALUES (167,'2018_10_10_251800_create_project_template_tasks_table',1); INSERT INTO `migrations` VALUES (168,'2018_10_16_095816_add_holiday_module_detail',1); INSERT INTO `migrations` VALUES (169,'2018_10_17_081757_remove_config_datatable_file',1); INSERT INTO `migrations` VALUES (170,'2018_10_17_965158_alter_leads_address_table',1); INSERT INTO `migrations` VALUES (171,'2018_10_17_965168_alter_leads_phone_table',1); INSERT INTO `migrations` VALUES (172,'2018_10_18_091643_alter_attendance_setting_table',1); INSERT INTO `migrations` VALUES (173,'2018_10_19_045718_add_holidays_permission',1); INSERT INTO `migrations` VALUES (174,'2018_10_20_094413_add_products_module',1); INSERT INTO `migrations` VALUES (175,'2018_10_20_094504_add_products_permissions',1); INSERT INTO `migrations` VALUES (176,'2018_10_21_051239_alter_holiday_website_table',1); INSERT INTO `migrations` VALUES (177,'2018_10_24_071300_add_file_column_to_invoices_table',1); INSERT INTO `migrations` VALUES (178,'2018_10_24_965158_alter_employee_detail_table',1); INSERT INTO `migrations` VALUES (179,'2018_10_29_965158_alter_attendance_setting_default_table',1); INSERT INTO `migrations` VALUES (180,'2018_11_10_071300_alter_user_table',1); INSERT INTO `migrations` VALUES (181,'2018_11_10_122646_create_task_category_table',1); INSERT INTO `migrations` VALUES (182,'2018_11_30_965158_alter_invoice_item_table',1); INSERT INTO `migrations` VALUES (183,'2018_12_12_965158_alter_invoice_estimate_response_table',1); INSERT INTO `migrations` VALUES (184,'2018_12_14_094504_add_expenses_permissions',1); INSERT INTO `migrations` VALUES (185,'2018_12_14_194504_add_expenses_permissions_detail',1); INSERT INTO `migrations` VALUES (186,'2018_12_20_1065158_alter_company_setting_table',1); INSERT INTO `migrations` VALUES (187,'2018_12_20_965158_alter_estimate_quantity_table',1); INSERT INTO `migrations` VALUES (188,'2018_12_27_074504_check_verify_purchase_file',1); INSERT INTO `migrations` VALUES (189,'2018_12_28_075730_create_push_notification_settings_table',1); INSERT INTO `migrations` VALUES (190,'2018_12_28_082056_add_send_push_column_email_notification_table',1); INSERT INTO `migrations` VALUES (191,'2018_12_28_123245_add_onesignal_player_id_column_users_table',1); INSERT INTO `migrations` VALUES (192,'2019_01_02_1065158_alter_module_setting_table',1); INSERT INTO `migrations` VALUES (193,'2019_01_02_2065158_insert_module_setting_client_table',1); INSERT INTO `migrations` VALUES (194,'2019_01_04_110029_create_employee_docs_table',1); INSERT INTO `migrations` VALUES (195,'2019_01_21_1065158_alter_task_creator_table',1); INSERT INTO `migrations` VALUES (196,'2019_02_06_1065158_alter_attendance_check_table',1); INSERT INTO `migrations` VALUES (197,'2019_02_11_1065158_alter_log_time_for_table',1); INSERT INTO `migrations` VALUES (198,'2019_02_12_2065158_insert_module_setting_client_task_table',1); INSERT INTO `migrations` VALUES (199,'2019_02_13_110029_create_skills_table',1); INSERT INTO `migrations` VALUES (200,'2019_02_13_130029_create_employee_skills_table',1); INSERT INTO `migrations` VALUES (201,'2019_02_15_1065158_alter_employee_end_date_table',1); INSERT INTO `migrations` VALUES (202,'2019_02_15_1165158_alter_custom_status_table',1); INSERT INTO `migrations` VALUES (203,'2019_02_20_074848_create_jobs_table',1); INSERT INTO `migrations` VALUES (204,'2019_02_22_1165158_add_company_currency_api_google_api',1); INSERT INTO `migrations` VALUES (205,'2019_03_11_965158_alter_expenses_quantity_table',1); INSERT INTO `migrations` VALUES (206,'2019_04_03_965158_alter_project_deadline_table',1); INSERT INTO `migrations` VALUES (207,'2019_04_04_074848_alter_invoice_setting_table',1); INSERT INTO `migrations` VALUES (208,'2019_04_04_075848_alter_client_Details_table',1); INSERT INTO `migrations` VALUES (209,'2019_04_10_075848_alter_setting_task_table',1); INSERT INTO `migrations` VALUES (210,'2019_04_10_122921_add_weather_key_column',1); INSERT INTO `migrations` VALUES (211,'2019_04_12_100242_add_columns_projects_table',1); INSERT INTO `migrations` VALUES (212,'2019_04_15_115700_add_budget_columns_projects_table',1); INSERT INTO `migrations` VALUES (213,'2019_04_17_070105_create_project_milestones_table',1); INSERT INTO `migrations` VALUES (214,'2019_04_23_062017_add_item_summary_column_invoice_item_table',1); INSERT INTO `migrations` VALUES (215,'2019_04_23_083812_add_invoice_created_column_project_milestones_table',1); INSERT INTO `migrations` VALUES (216,'2019_04_23_101747_add_milestone_id_column_tasks_table',1); INSERT INTO `migrations` VALUES (217,'2019_06_04_180628_change_project_budget_field_type',1); INSERT INTO `migrations` VALUES (218,'2019_06_07_070913_add_tax_id_column_estimate_items_table',1); INSERT INTO `migrations` VALUES (219,'2019_06_07_080053_add_discount_column_estimates_table',1); INSERT INTO `migrations` VALUES (220,'2019_07_01_192543_change_size_price_in_double',1); INSERT INTO `migrations` VALUES (221,'2019_07_02_072314_add_description_column_products_table',1); INSERT INTO `migrations` VALUES (222,'2019_07_15_110127_add_project_id_column_in_expenses_table',1); INSERT INTO `migrations` VALUES (223,'2019_08_13_073129_update_settings_add_envato_key',1); INSERT INTO `migrations` VALUES (224,'2019_08_13_073129_update_settings_add_support_key',1); INSERT INTO `migrations` VALUES (225,'2019_08_16_080219_change_price_size_proposal',1); INSERT INTO `migrations` VALUES (226,'2019_08_17_072443_add_datepicker_format_column_in_settings',1); INSERT INTO `migrations` VALUES (227,'2019_08_19_000000_create_failed_jobs_table',1); INSERT INTO `migrations` VALUES (228,'2019_08_19_085009_add_google_recaptcha_columns_in_organisation_settings_table',1); INSERT INTO `migrations` VALUES (229,'2019_08_19_120826_add_app_debug_column_in_organisation_settings_table',1); INSERT INTO `migrations` VALUES (230,'2019_08_22_055908_add_invoice_email_setting_to_email_notification_setting_table',1); INSERT INTO `migrations` VALUES (231,'2019_08_22_121805_add_external_link_column_project_files_table',1); INSERT INTO `migrations` VALUES (232,'2019_08_26_120718_add_offline_method_id_column_payments_table',1); INSERT INTO `migrations` VALUES (233,'2019_08_28_081847_update_smtp_setting_verified',1); INSERT INTO `migrations` VALUES (234,'2019_08_29_140115_make_smtp_type_nullable',1); INSERT INTO `migrations` VALUES (235,'2019_08_30_102114_add_reminder_fields_in_events_table',1); INSERT INTO `migrations` VALUES (236,'2019_09_03_103533_add_razorpay_column',1); INSERT INTO `migrations` VALUES (237,'2019_09_04_115714_add_recurring_task_id_column_in_tasks_table',1); INSERT INTO `migrations` VALUES (238,'2019_09_05_061308_create_project_settings_table',1); INSERT INTO `migrations` VALUES (239,'2019_09_09_045256_add_estimate_number_column_in_estimates_table',1); INSERT INTO `migrations` VALUES (240,'2019_09_09_081030_add_rounded_theme_column',1); INSERT INTO `migrations` VALUES (241,'2019_09_09_115714_add_cron_job_message_hide_table',1); INSERT INTO `migrations` VALUES (242,'2019_09_10_1074848_create_designation_table',1); INSERT INTO `migrations` VALUES (243,'2019_09_10_111909_add_columns_in_invoice_settings_table',1); INSERT INTO `migrations` VALUES (244,'2019_09_10_115714_add_team_field_employee_table',1); INSERT INTO `migrations` VALUES (245,'2019_09_10_161408_create_credit_note_table',1); INSERT INTO `migrations` VALUES (246,'2019_09_10_161418_create_credit_note_item_table',1); INSERT INTO `migrations` VALUES (247,'2019_09_10_161428_add_credit_note_column_in_invoices_table',1); INSERT INTO `migrations` VALUES (248,'2019_09_14_074854_add_status_column_projects_table',1); INSERT INTO `migrations` VALUES (249,'2019_09_16_101138_create_gdpr_settings_table',1); INSERT INTO `migrations` VALUES (250,'2019_09_17_091214_create_removal_requests_table',1); INSERT INTO `migrations` VALUES (251,'2019_09_18_191957_add_payments_module_clients',1); INSERT INTO `migrations` VALUES (252,'2019_09_25_095015_create_removal_requests_lead_table',1); INSERT INTO `migrations` VALUES (253,'2019_09_25_183130_create_dashboard_widgets_table',1); INSERT INTO `migrations` VALUES (254,'2019_09_27_212735_add_timelog_module_clients',1); INSERT INTO `migrations` VALUES (255,'2019_10_04_101818_add_paypal_mode_in_payment_gateway_credentials_table',1); INSERT INTO `migrations` VALUES (256,'2019_10_10_115133_alter_status_column_in_estimates_table',1); INSERT INTO `migrations` VALUES (257,'2019_10_14_060314_create_accept_estimates_table',1); INSERT INTO `migrations` VALUES (258,'2019_10_14_090840_alter_project_id_column_in_invoices_table',1); INSERT INTO `migrations` VALUES (259,'2019_10_14_110606_add_estimate_id_column_in_invoices_table',1); INSERT INTO `migrations` VALUES (260,'2019_10_15_052931_create_contract_types_table',1); INSERT INTO `migrations` VALUES (261,'2019_10_15_052932_create_contracts_table',1); INSERT INTO `migrations` VALUES (262,'2019_10_15_084310_add_contract_module_in_module_settings',1); INSERT INTO `migrations` VALUES (263,'2019_10_15_115655_create_contract_signs_table',1); INSERT INTO `migrations` VALUES (264,'2019_10_15_120940_create_invoice_credit_note_pivot_table',1); INSERT INTO `migrations` VALUES (265,'2019_10_17_051544_create_contract_discussions_table',1); INSERT INTO `migrations` VALUES (266,'2019_10_18_045028_alter_credit_note_status_in_credit_notes_table',1); INSERT INTO `migrations` VALUES (267,'2019_10_21_130413_create_task_files_table',1); INSERT INTO `migrations` VALUES (268,'2019_10_21_230413_create_ticket_files_table',1); INSERT INTO `migrations` VALUES (269,'2019_10_22_063419_add_dependent_task_id_in_tasks_table',1); INSERT INTO `migrations` VALUES (270,'2019_10_23_122412_create_contract_renews_table',1); INSERT INTO `migrations` VALUES (271,'2019_10_24_045038_add_column_module_type_in_universal_search_table',1); INSERT INTO `migrations` VALUES (272,'2019_10_24_120220_add_origin_amount_column_in_contracts_table',1); INSERT INTO `migrations` VALUES (273,'2019_10_30_045045_add_column_invoice_item_table',1); INSERT INTO `migrations` VALUES (274,'2019_10_30_122412_create_lead_agent_table',1); INSERT INTO `migrations` VALUES (275,'2019_10_31_045055_add_column_credit_note_item_table',1); INSERT INTO `migrations` VALUES (276,'2019_10_31_045065_add_column_estimate_item_table',1); INSERT INTO `migrations` VALUES (277,'2019_11_01_045075_add_column_products_table',1); INSERT INTO `migrations` VALUES (278,'2019_11_01_142619_add_column_to_in_notices_table',1); INSERT INTO `migrations` VALUES (279,'2019_11_05_082637_add_client_id_in_invoices_table',1); INSERT INTO `migrations` VALUES (280,'2019_11_07_082637_add_purchase_allow_in_product_table',1); INSERT INTO `migrations` VALUES (281,'2019_11_12_054145_add_system_update_column_in_organisation_settings_table',1); INSERT INTO `migrations` VALUES (282,'2019_11_13_054155_add_employee_id_column_in_employee_details_table',1); INSERT INTO `migrations` VALUES (283,'2019_11_14_054145_add_discount_column_in_proposal_table',1); INSERT INTO `migrations` VALUES (284,'2019_11_14_064145_add_tax_column_in_proposal_item_table',1); INSERT INTO `migrations` VALUES (285,'2019_11_21_064155_add_task_module_in_module_setting_table',1); INSERT INTO `migrations` VALUES (286,'2019_12_01_115133_alter_invoice_status_table',1); INSERT INTO `migrations` VALUES (287,'2019_12_09_171149_make_taxes_nullable_propsal_items_table',1); INSERT INTO `migrations` VALUES (288,'2019_12_18_115133_alter_proposal_items_table',1); INSERT INTO `migrations` VALUES (289,'2019_12_19_115850_add_timelogs_client_modules',1); INSERT INTO `migrations` VALUES (290,'2019_12_20_143625_add_logo_background_color_column_settings_table',1); INSERT INTO `migrations` VALUES (291,'2020_01_09_100241_add_client_id_credit_note_table',1); INSERT INTO `migrations` VALUES (292,'2020_01_09_105514_set_default_status_credit_note_open',1); INSERT INTO `migrations` VALUES (293,'2020_01_09_121406_add_task_reminder_columns',1); INSERT INTO `migrations` VALUES (294,'2020_01_22_122009_add_is_private_column_tasks_table',1); INSERT INTO `migrations` VALUES (295,'2020_01_23_062328_create_task_history_table',1); INSERT INTO `migrations` VALUES (296,'2020_01_24_134008_add_default_task_status_column_organisation_settings',1); INSERT INTO `migrations` VALUES (297,'2020_01_27_122145_create_pusher_settings_table',1); INSERT INTO `migrations` VALUES (298,'2020_02_01_101914_update_settings_review',1); INSERT INTO `migrations` VALUES (299,'2020_02_04_061753_add_team_id_field_in_projects_table',1); INSERT INTO `migrations` VALUES (300,'2020_02_04_132100_add_contracts_permission',1); INSERT INTO `migrations` VALUES (301,'2020_02_10_093726_create_table_menu',1); INSERT INTO `migrations` VALUES (302,'2020_02_14_102832_create_task_users_table',1); INSERT INTO `migrations` VALUES (303,'2020_02_17_143257_add_slug_email_notification_table',1); INSERT INTO `migrations` VALUES (304,'2020_02_21_121956_update_storage_settings_to_local',1); INSERT INTO `migrations` VALUES (305,'2020_02_24_060416_update_invoice_setting_logo',1); INSERT INTO `migrations` VALUES (306,'2020_03_11_054833_add_shipping_address_field_in_client_details_table',1); INSERT INTO `migrations` VALUES (307,'2020_03_11_085729_add_show_shipping_field_in_invoices_table',1); INSERT INTO `migrations` VALUES (308,'2020_03_17_411909_alter_invocie_number_in_invoice_table',1); INSERT INTO `migrations` VALUES (309,'2020_03_19_112832_create_project_template_task_users_table',1); INSERT INTO `migrations` VALUES (310,'2020_03_20_2065158_insert_modules_setting_client_table',1); INSERT INTO `migrations` VALUES (311,'2020_03_23_185549_make_message_nullable_ticket_reply_table',1); INSERT INTO `migrations` VALUES (312,'2020_04_06_130331_create_discussion_categories_table',1); INSERT INTO `migrations` VALUES (313,'2020_04_06_132027_create_discussions_table',1); INSERT INTO `migrations` VALUES (314,'2020_04_06_133759_create_discussion_replies_table',1); INSERT INTO `migrations` VALUES (315,'2020_04_08_094325_add_best_answer_id_discussions_table',1); INSERT INTO `migrations` VALUES (316,'2020_04_08_125803_add_discussion_reply_email_notification_settings_table',1); INSERT INTO `migrations` VALUES (317,'2020_04_09_102411_add_last_reply_by_discussions_table',1); INSERT INTO `migrations` VALUES (318,'2020_04_12_2065158_insert_contract_employee_modules_setting_table',1); INSERT INTO `migrations` VALUES (319,'2020_04_14_144941_add_last_login_column_users_table',1); INSERT INTO `migrations` VALUES (320,'2020_04_20_083724_add_hourly_rate_project_timelogs',1); INSERT INTO `migrations` VALUES (321,'2020_04_20_114349_add_hourly_rate_project_members',1); INSERT INTO `migrations` VALUES (322,'2020_04_20_173833_add_project_id_value_for_tasks_timelogs',1); INSERT INTO `migrations` VALUES (323,'2020_04_23_124301_add_billable_column_tasks_table',1); INSERT INTO `migrations` VALUES (324,'2020_04_24_115049_add_approved_invoice_id_column_project_time_logs',1); INSERT INTO `migrations` VALUES (325,'2020_04_24_122510_add_approval_required_column_log_time_for',1); INSERT INTO `migrations` VALUES (326,'2020_05_13_070505_change_earning_by_minutes_timelogs',1); INSERT INTO `migrations` VALUES (327,'2020_05_13_113533_add_receipt_column_payments_table',1); INSERT INTO `migrations` VALUES (328,'2020_05_19_114539_add_custom_field_groups',1); INSERT INTO `migrations` VALUES (329,'2020_05_20_131017_change_project_team_id_cascade',1); INSERT INTO `migrations` VALUES (330,'2020_05_21_041143_create_social_auth_settings_table',1); INSERT INTO `migrations` VALUES (331,'2020_05_26_084027_add_column_expenses_table',1); INSERT INTO `migrations` VALUES (332,'2020_05_30_093624_add_send_status_column_invoices_table',1); INSERT INTO `migrations` VALUES (333,'2020_06_01_080620_add_send_status_column_estimates_table',1); INSERT INTO `migrations` VALUES (334,'2020_06_02_160923_add_email_notifications_column_users_table',1); INSERT INTO `migrations` VALUES (335,'2020_06_15_100530_create_task_tag_list_table',1); INSERT INTO `migrations` VALUES (336,'2020_06_15_116005_create_task_tags_table',1); INSERT INTO `migrations` VALUES (337,'2020_06_16_160933_alter_date_format_table',1); INSERT INTO `migrations` VALUES (338,'2020_06_20_030225_alter_task_tags_to_label_table',1); INSERT INTO `migrations` VALUES (339,'2020_06_26_131840_add_column_priority_column_leads_table',1); INSERT INTO `migrations` VALUES (340,'2020_06_29_141051_create_sessions_table',1); INSERT INTO `migrations` VALUES (341,'2020_07_06_171614_add_phone_country_code_column_users_table',1); INSERT INTO `migrations` VALUES (342,'2020_07_07_2065158_insert_module_setting_client_expense_payment_table',1); INSERT INTO `migrations` VALUES (343,'2020_07_08_2065258_enter_lead_status_id_table',1); INSERT INTO `migrations` VALUES (344,'2020_07_08_2931840_add_column_category_id_in_template_task_table',1); INSERT INTO `migrations` VALUES (345,'2020_07_15_112558_add_default_currency_projects',1); INSERT INTO `migrations` VALUES (346,'2020_07_16_583130_alter_dashboard_widgets_table',1); INSERT INTO `migrations` VALUES (347,'2020_07_21_583130_add_due_amount_column_in_invoice_table',1); INSERT INTO `migrations` VALUES (348,'2020_08_13_114705_set_task_category_id_column_null',1); INSERT INTO `migrations` VALUES (349,'2020_08_19_051839_create_employee_leave_quotas_table',1); INSERT INTO `migrations` VALUES (350,'2020_08_25_081839_add_columns_in_notices_table',1); INSERT INTO `migrations` VALUES (351,'2020_08_25_081839_alter_leads_value_table',1); INSERT INTO `migrations` VALUES (352,'2020_08_28_081839_add_columns_parent_in_invoice_table',1); INSERT INTO `migrations` VALUES (353,'2020_09_17_114705_set_credit_note_amount',1); INSERT INTO `migrations` VALUES (354,'2020_09_17_196005_create_task_notes_table',1); INSERT INTO `migrations` VALUES (355,'2020_09_18_104145_add_estimate_fields_tasks_table',1); INSERT INTO `migrations` VALUES (356,'2020_09_24_522646_create_expenses_category_table',1); INSERT INTO `migrations` VALUES (357,'2020_09_28_054230_create_expenses_recurring_table',1); INSERT INTO `migrations` VALUES (358,'2020_10_06_522646_create_product_category_table',1); INSERT INTO `migrations` VALUES (359,'2020_10_07_522646_create_pinned_table',1); INSERT INTO `migrations` VALUES (360,'2020_10_15_054230_create_invoice_recurring_table',1); INSERT INTO `migrations` VALUES (361,'2020_10_20_094043_add_dashboard_clock_column_organisation_setting_table',1); INSERT INTO `migrations` VALUES (362,'2020_10_29_111515_add_companylogo_address_column_in_contracts_table',1); INSERT INTO `migrations` VALUES (363,'2020_11_02_130413_create_contract_files_table',1); INSERT INTO `migrations` VALUES (364,'2020_11_17_115634_add_lead_custom_field_group',1); INSERT INTO `migrations` VALUES (365,'2020_11_18_065533_create_lead_custom_forms_table',1); INSERT INTO `migrations` VALUES (366,'2020_11_18_083624_add_city_state_to_client_details',1); INSERT INTO `migrations` VALUES (367,'2020_11_18_090244_add_city_state_to_leads_table',1); INSERT INTO `migrations` VALUES (368,'2020_11_19_063807_add_city_state_column_in_contracts_table',1); INSERT INTO `migrations` VALUES (369,'2020_11_19_091349_alter_country_cell_column_in_client_details',1); INSERT INTO `migrations` VALUES (370,'2020_11_20_104942_create_lead_category_table',1); INSERT INTO `migrations` VALUES (371,'2020_11_23_052427_add_category_id_column_in_leads_table',1); INSERT INTO `migrations` VALUES (372,'2020_11_25_114705_cancel_status_estimate',1); INSERT INTO `migrations` VALUES (373,'2020_11_27_092136_create_project_template_sub_tasks_table',1); INSERT INTO `migrations` VALUES (374,'2020_12_01_092136_create_notice_view_table',1); INSERT INTO `migrations` VALUES (375,'2020_12_02_055908_add_product_purchase_email_notification_setting_table',1); INSERT INTO `migrations` VALUES (376,'2020_12_03_065533_create_ticket_custom_forms_table',1); INSERT INTO `migrations` VALUES (377,'2020_12_04_114305_create_client_category_table',1); INSERT INTO `migrations` VALUES (378,'2020_12_08_075308_create_project_rating_table',1); INSERT INTO `migrations` VALUES (379,'2020_12_08_082101_add_paid_column_in_leave_types',1); INSERT INTO `migrations` VALUES (380,'2020_12_08_110140_add_paid_column_in_leaves_table',1); INSERT INTO `migrations` VALUES (381,'2020_12_21_072055_create_permission_types_table',1); INSERT INTO `migrations` VALUES (382,'2020_12_21_072058_create_user_permissions_table',1); INSERT INTO `migrations` VALUES (383,'2020_12_21_132255_add_user_permisisons',1); INSERT INTO `migrations` VALUES (384,'2020_12_22_071337_add_owned_by_added_by_last_updated_by_columns',1); INSERT INTO `migrations` VALUES (385,'2020_12_28_200000_add_two_factor_columns_to_users_table',1); INSERT INTO `migrations` VALUES (386,'2020_12_30_101513_add_owned_by_added_by_last_updated_by_columns_projects',1); INSERT INTO `migrations` VALUES (387,'2021_01_11_110041_add_owned_by_added_by_last_updated_by_columns_tasks',1); INSERT INTO `migrations` VALUES (388,'2021_01_18_084827_add_estimate_terms_column_invoice_settings',1); INSERT INTO `migrations` VALUES (389,'2021_01_19_060745_add_slug_new_product_purchase_in_email_notification_table',1); INSERT INTO `migrations` VALUES (390,'2021_01_29_152503_lead_custom_field_name_change',1); INSERT INTO `migrations` VALUES (391,'2021_02_05_055908_add_lead_proposal_email_setting',1); INSERT INTO `migrations` VALUES (392,'2021_02_05_114041_create_user_taskboard_settings_table',1); INSERT INTO `migrations` VALUES (393,'2021_02_08_115655_create_proposal_signs_table',1); INSERT INTO `migrations` VALUES (394,'2021_02_15_085425_modify_status_column_in_projects_table',1); INSERT INTO `migrations` VALUES (395,'2021_02_15_135533_alter_lead_custom_forms_table',1); INSERT INTO `migrations` VALUES (396,'2021_02_16_082106_add_mobile_column_in_tickets_table',1); INSERT INTO `migrations` VALUES (397,'2021_02_16_100313_add_added_by_last_updated_by_columns_to_events_table',1); INSERT INTO `migrations` VALUES (398,'2021_02_16_102604_add_added_by_last_updated_by_columns_to_products_table',1); INSERT INTO `migrations` VALUES (399,'2021_02_16_102906_add_added_by_last_updated_by_columns_to_notices_table',1); INSERT INTO `migrations` VALUES (400,'2021_02_17_122943_change_client_details_foreign_table',1); INSERT INTO `migrations` VALUES (401,'2021_02_19_102125_add_salutation_column_to_leads_table',1); INSERT INTO `migrations` VALUES (402,'2021_02_20_185545_add_owned_by_added_by_last_updated_by_columns_invoices',1); INSERT INTO `migrations` VALUES (403,'2021_02_22_101316_add_owned_by_added_by_last_updated_by_columns_payments',1); INSERT INTO `migrations` VALUES (404,'2021_02_23_173243_add_column_length_column',1); INSERT INTO `migrations` VALUES (405,'2021_02_24_084749_add_owned_by_added_by_last_updated_by_columns_estimates',1); INSERT INTO `migrations` VALUES (406,'2021_02_25_052941_add_owned_by_added_by_last_updated_by_columns_leads',1); INSERT INTO `migrations` VALUES (407,'2021_02_26_092320_create_currency_format_settings_table',1); INSERT INTO `migrations` VALUES (408,'2021_02_26_092817_add_sac_code_invoice_table',1); INSERT INTO `migrations` VALUES (409,'2021_02_27_070155_add_added_by_last_updated_by_columns_to_leaves_table',1); INSERT INTO `migrations` VALUES (410,'2021_02_28_095653_add_owned_by_added_by_last_updated_by_columns_expenses',1); INSERT INTO `migrations` VALUES (411,'2021_03_01_133056_create_user_leadboard_settings_table',1); INSERT INTO `migrations` VALUES (412,'2021_03_03_071758_add_owned_by_added_by_last_updated_by_columns_tinelogs',1); INSERT INTO `migrations` VALUES (413,'2021_03_03_130641_add_moment_format_column_settings_table',1); INSERT INTO `migrations` VALUES (414,'2021_03_04_060745_add_new_for_null_slug_email_notification_table',1); INSERT INTO `migrations` VALUES (415,'2021_03_08_022302_add_added_by_last_updated_by_columns_to_holidays_table',1); INSERT INTO `migrations` VALUES (416,'2021_03_09_123344_add_owned_by_added_by_last_updated_by_columns_contracts',1); INSERT INTO `migrations` VALUES (417,'2021_03_11_070400_update_contract_type_cascade',1); INSERT INTO `migrations` VALUES (418,'2021_03_15_112622_add_owned_by_added_by_last_updated_by_columns_attendance',1); INSERT INTO `migrations` VALUES (419,'2021_03_15_145533_add_last_cron_run_in_organisation_settings_table',1); INSERT INTO `migrations` VALUES (420,'2021_03_19_091501_add_favicon_in_organisation_settings_table',1); INSERT INTO `migrations` VALUES (421,'2021_03_19_123557_add_owned_by_added_by_last_updated_by_columns_tickets',1); INSERT INTO `migrations` VALUES (422,'2021_04_06_111105_sync_default_role_permission',1); INSERT INTO `migrations` VALUES (423,'2021_04_08_021853_add_owned_by_added_by_last_updated_by_columns_invoice_recurring',1); INSERT INTO `migrations` VALUES (424,'2021_04_14_080502_add_decription_column_in_proposals_table',1); INSERT INTO `migrations` VALUES (425,'2021_05_01_220324_add_dashboard_permissions',1); INSERT INTO `migrations` VALUES (426,'2021_05_03_055859_add_owned_by_added_by_last_updated_by_columns_credit_notes_table',1); INSERT INTO `migrations` VALUES (427,'2021_05_17_133302_reset_theme_default_colors',1); INSERT INTO `migrations` VALUES (428,'2021_05_26_102905_craete_client_notes_table',1); INSERT INTO `migrations` VALUES (429,'2021_05_30_174638_craete_project_notes_table',1); INSERT INTO `migrations` VALUES (430,'2021_05_31_050747_add_send_reminder_in_invoice_setting_table',1); INSERT INTO `migrations` VALUES (431,'2021_05_31_102117_task_share_unique_hash',1); INSERT INTO `migrations` VALUES (432,'2021_06_03_104606_add_owned_by_added_by_last_updated_by_columns_project_ratings',1); INSERT INTO `migrations` VALUES (433,'2021_06_07_132858_create_user_invitations_table',1); INSERT INTO `migrations` VALUES (434,'2021_06_08_072201_add_close_date_in_ticket_table',1); INSERT INTO `migrations` VALUES (435,'2021_06_09_101110_remove_visible_rating_employee_column_from_projects_table',1); INSERT INTO `migrations` VALUES (436,'2021_06_16_185748_add_dark_theme_column_users_table',1); INSERT INTO `migrations` VALUES (437,'2021_06_24_185748_add_column_payment_gateway_credentials_table',1); INSERT INTO `migrations` VALUES (438,'2021_06_29_104606_add_manage_project_template_permission',1); INSERT INTO `migrations` VALUES (439,'2021_07_07_093528_alter_userid_on_project_template_member',1); INSERT INTO `migrations` VALUES (440,'2021_07_20_102117_invoice_client_fix',1); INSERT INTO `migrations` VALUES (441,'2021_07_23_181545_add_status_column_to_slack_settings_table',1); INSERT INTO `migrations` VALUES (442,'2021_07_25_041851_add_report_permissions',1); INSERT INTO `migrations` VALUES (443,'2021_08_04_171200_add_mail_connection_column_email_settings',1); INSERT INTO `migrations` VALUES (444,'2021_08_06_085318_remove_on_delete_cascade_from_category_id_on_products_table',1); INSERT INTO `migrations` VALUES (445,'2021_08_10_081641_change_default_value_of_paypal_and_stripe_on_payment_gateway_credentials_table',1); INSERT INTO `migrations` VALUES (446,'2021_08_10_092728_add_allowed_permission_column_permissions_table',1); INSERT INTO `migrations` VALUES (447,'2021_08_10_092728_alter_allowed_permission_column_permissions_table',1); INSERT INTO `migrations` VALUES (448,'2021_08_13_094921_change_notification_notifications_table',1); INSERT INTO `migrations` VALUES (449,'2021_08_16_161256_set_discussion_category_id_null_on_category_delete',1); INSERT INTO `migrations` VALUES (450,'2021_08_17_095756_change_details_columns_type_to_longtext_on_client_note_and_project_note_tables',1); INSERT INTO `migrations` VALUES (451,'2021_08_19_174641_change_text_longtext',1); INSERT INTO `migrations` VALUES (452,'2021_08_20_100009_change_hourly_rate_double',1); INSERT INTO `migrations` VALUES (453,'2021_08_20_121027_add_dashboard_module_permission',1); INSERT INTO `migrations` VALUES (454,'2021_08_23_125630_create_orders_table',1); INSERT INTO `migrations` VALUES (455,'2021_08_26_120755_add_order_id_column_to_payments_table',1); INSERT INTO `migrations` VALUES (456,'2021_08_27_100840_add_order_id_to_invoices_table',1); INSERT INTO `migrations` VALUES (457,'2021_08_31_071303_add_failed_status_on_payments_table',1); INSERT INTO `migrations` VALUES (458,'2021_09_01_124609_add_order_module_and_permissions',1); INSERT INTO `migrations` VALUES (459,'2021_09_02_080343_add_hash_columns',1); INSERT INTO `migrations` VALUES (460,'2021_09_02_182736_add_notice_module_clients',1); INSERT INTO `migrations` VALUES (461,'2021_09_03_182020_add_default_permissions',1); INSERT INTO `migrations` VALUES (462,'2021_09_06_182020_change_dashboard_widget_name',1); INSERT INTO `migrations` VALUES (463,'2021_09_07_084452_delete_notices_module_from_client',1); INSERT INTO `migrations` VALUES (464,'2021_09_08_142150_add_payment_gateway_response_column_to_payment_table',1); INSERT INTO `migrations` VALUES (465,'2021_09_09_085024_add_taskboard_message_pusher_settings',1); INSERT INTO `migrations` VALUES (466,'2021_09_14_162221_add_payload_id_to_payments_table',1); INSERT INTO `migrations` VALUES (467,'2021_09_15_072728_copy_credit_notes_invoice_table_data_to_payments_table',1); INSERT INTO `migrations` VALUES (468,'2021_09_15_190915_add_column_calculate_tax',1); INSERT INTO `migrations` VALUES (469,'2021_09_17_115037_remove_credit_notes_invoice_table',1); INSERT INTO `migrations` VALUES (470,'2021_09_20_095509_alter_and_add_payment_gateways_credentials',1); INSERT INTO `migrations` VALUES (471,'2021_09_22_045939_change_subtask_in_notifications_table',1); INSERT INTO `migrations` VALUES (472,'2021_09_22_085009_change_google_recaptcha_columns_in_organisation_settings_table',1); INSERT INTO `migrations` VALUES (473,'2021_09_24_083220_add_currency_id_to_contracts_table',1); INSERT INTO `migrations` VALUES (474,'2021_09_24_100722_add_view_hourly_rate_permission',1); INSERT INTO `migrations` VALUES (475,'2021_09_29_071418_add_salutation_column_on_users_table',1); INSERT INTO `migrations` VALUES (476,'2021_09_29_075245_add_lead_status_change_permission',1); INSERT INTO `migrations` VALUES (477,'2021_09_30_130413_attendance_setting_alert',1); INSERT INTO `migrations` VALUES (478,'2021_10_01_074809_add_leave_change_permission',1); INSERT INTO `migrations` VALUES (479,'2021_10_03_190531_add_sidebar_logo_style_column_global_settings',1); INSERT INTO `migrations` VALUES (480,'2021_10_04_045942_add_2fa_columns_on_users_table',1); INSERT INTO `migrations` VALUES (481,'2021_10_04_130413_create_expenses_category_roles_table',1); INSERT INTO `migrations` VALUES (482,'2021_10_05_064140_change_date_null_in_task_table',1); INSERT INTO `migrations` VALUES (483,'2021_10_05_130413_custom_field_group_change_table',1); INSERT INTO `migrations` VALUES (484,'2021_10_06_130413_create_sub_task_files_table',1); INSERT INTO `migrations` VALUES (485,'2021_10_11_092617_add_session_driver_column_organisation_settings',1); INSERT INTO `migrations` VALUES (486,'2021_10_12_062814_change_authenticate_via_column',1); INSERT INTO `migrations` VALUES (487,'2021_10_12_073058_make_email_nullable_users_table',1); INSERT INTO `migrations` VALUES (488,'2021_10_12_121613_add_approve_reject_leaves_permissions',1); INSERT INTO `migrations` VALUES (489,'2021_10_13_103621_add_client_signup_columns_settings_table',1); INSERT INTO `migrations` VALUES (490,'2021_10_14_073904_add_admin_approval_column_users_table',1); INSERT INTO `migrations` VALUES (491,'2021_10_16_113306_add_two_factor_confirmed_column_users_table',1); INSERT INTO `migrations` VALUES (492,'2021_10_18_131815_allow_gender_null',1); INSERT INTO `migrations` VALUES (493,'2021_10_21_104332_add_employee_owned_permissions',1); INSERT INTO `migrations` VALUES (494,'2021_10_26_175349_change_ticket_permissions',1); INSERT INTO `migrations` VALUES (495,'2021_10_28_120427_add_recurring_columns_tasks',1); INSERT INTO `migrations` VALUES (496,'2021_11_11_145726_add_allowed_file_types_column',1); INSERT INTO `migrations` VALUES (497,'2021_11_13_063519_add_paystack_to_payment_gateway_credentials',1); INSERT INTO `migrations` VALUES (498,'2021_11_16_105840_change_product_sub_cat_relation',1); INSERT INTO `migrations` VALUES (499,'2021_11_17_111317_add_mollie_to_payment_gateway_credentials',1); INSERT INTO `migrations` VALUES (500,'2021_11_17_173210_create_company_addresses_table',1); INSERT INTO `migrations` VALUES (501,'2021_11_18_053337_add_tax_calculation_msg_to_invoice_settings_table',1); INSERT INTO `migrations` VALUES (502,'2021_11_19_115843_add_project_type_column_projects',1); INSERT INTO `migrations` VALUES (503,'2021_11_22_114532_move_gst_to_compane_address',1); INSERT INTO `migrations` VALUES (504,'2021_11_24_093356_add_payfast_to_payment_gateway_credentials',1); INSERT INTO `migrations` VALUES (505,'2021_11_24_093619_create_invoice_item_images_table',1); INSERT INTO `migrations` VALUES (506,'2021_11_25_134531_fix_timelog_time',1); INSERT INTO `migrations` VALUES (507,'2021_11_26_063416_add_authorize_to_payment_gateway_credentials',1); INSERT INTO `migrations` VALUES (508,'2021_11_29_060348_create_discussion_files_table',1); INSERT INTO `migrations` VALUES (509,'2021_11_30_063441_add_square_to_payment_gateway_credentials',1); INSERT INTO `migrations` VALUES (510,'2021_12_08_100451_add_image_column_to_products_table',1); INSERT INTO `migrations` VALUES (511,'2021_12_10_112406_add_permission_sync_column_users_table',1); INSERT INTO `migrations` VALUES (512,'2021_12_13_070928_add_proposal_items_images_table',1); INSERT INTO `migrations` VALUES (513,'2021_12_14_112039_add_location_column_company_addresses',1); INSERT INTO `migrations` VALUES (514,'2021_12_15_090905_create_recurring_invoice_item_images_table',1); INSERT INTO `migrations` VALUES (515,'2021_12_15_112911_add_recurring_expense_permission',1); INSERT INTO `migrations` VALUES (516,'2021_12_17_041814_create_job_batches_table',1); INSERT INTO `migrations` VALUES (517,'2021_12_20_053945_add_order_item_image_table',1); INSERT INTO `migrations` VALUES (518,'2021_12_21_044934_add_google_event_id_to_several_tables',1); INSERT INTO `migrations` VALUES (519,'2021_12_21_064709_add_title_field_in_client_contact_table',1); INSERT INTO `migrations` VALUES (520,'2021_12_21_121710_create_google_calendar_modules_table',1); INSERT INTO `migrations` VALUES (521,'2021_12_23_102347_change_clock_out_ip_make_nullable_to_attendances_table',1); INSERT INTO `migrations` VALUES (522,'2021_12_24_045226_add_paystack_mode_to_payment_gateway_credentials',1); INSERT INTO `migrations` VALUES (523,'2021_12_24_085109_add_save_location_column_attendance_settings',1); INSERT INTO `migrations` VALUES (524,'2021_12_27_065645_create_knowledgebase_categories_table',1); INSERT INTO `migrations` VALUES (525,'2021_12_27_090829_create_knowledge_bases_table',1); INSERT INTO `migrations` VALUES (526,'2021_12_28_112808_add_module_knowledgebase_and_permissions',1); INSERT INTO `migrations` VALUES (527,'2021_12_29_124232_add_lead_notes_table',1); INSERT INTO `migrations` VALUES (528,'2021_12_30_082542_add_added_by_column_knowledge_base_table',1); INSERT INTO `migrations` VALUES (529,'2022_01_03_090136_add_downloadable_to_products_table',1); INSERT INTO `migrations` VALUES (530,'2022_01_03_103014_create_database_backup_settings_table',1); INSERT INTO `migrations` VALUES (531,'2022_01_03_125020_add_product_id_to_order_items_table',1); INSERT INTO `migrations` VALUES (532,'2022_01_06_053854_set_product_description_to_nullable_in_products_table',1); INSERT INTO `migrations` VALUES (533,'2022_01_06_093627_add_default_permission_to_knowledge_bases_table',1); INSERT INTO `migrations` VALUES (534,'2022_01_11_104355_create_translate_settings_table',1); INSERT INTO `migrations` VALUES (535,'2022_01_13_080729_add_flutterwave_to_payment_gateway_credentials',1); INSERT INTO `migrations` VALUES (536,'2022_01_14_122713_add_change_role_permission',1); INSERT INTO `migrations` VALUES (537,'2022_01_15_055907_create_product_files_table',1); INSERT INTO `migrations` VALUES (538,'2022_01_19_112914_create_client_docs_table',1); INSERT INTO `migrations` VALUES (539,'2022_01_31_090302_add_missing_permissions_to_admin_role',1); INSERT INTO `migrations` VALUES (540,'2022_01_31_111358_change_reference_column_to_lead_notes_table',1); INSERT INTO `migrations` VALUES (541,'2022_02_01_104951_add_role_permissions_settings_permission',1); INSERT INTO `migrations` VALUES (542,'2022_02_01_113853_fix_permission_types',1); INSERT INTO `migrations` VALUES (543,'2022_02_03_065848_add_order_notification_to_email_notification_settings_table',1); INSERT INTO `migrations` VALUES (544,'2022_02_03_095618_change_quantity_type_in_order_items_table',1); INSERT INTO `migrations` VALUES (545,'2022_02_06_150726_add_product_custom_field_group',1); INSERT INTO `migrations` VALUES (546,'2022_02_07_175605_create_project_time_log_breaks_table',1); INSERT INTO `migrations` VALUES (547,'2022_02_09_084910_add_two_columns_in_sub_tasks_table',1); INSERT INTO `migrations` VALUES (548,'2022_02_10_083543_add_description_column_to_estimates_table',1); INSERT INTO `migrations` VALUES (549,'2022_02_11_182041_change_discussion_category_permission',1); INSERT INTO `migrations` VALUES (550,'2022_02_14_061344_add_birth_date_in_employee_detail_table',1); INSERT INTO `migrations` VALUES (551,'2022_02_14_101407_add_data_in_dashboard_widgets_table',1); INSERT INTO `migrations` VALUES (552,'2022_02_14_133011_remove_edit_project_file_permission',1); INSERT INTO `migrations` VALUES (553,'2022_02_14_180229_make_lead_email_nullable',1); INSERT INTO `migrations` VALUES (554,'2022_02_15_111216_update_notice_permissions',1); INSERT INTO `migrations` VALUES (555,'2022_02_15_151924_remove_product_file_permission',1); INSERT INTO `migrations` VALUES (556,'2022_02_16_063017_add_user_notification_to_email_notification_settings_table',1); INSERT INTO `migrations` VALUES (557,'2022_02_16_072041_remove_lead_file_permission',1); INSERT INTO `migrations` VALUES (558,'2022_02_16_173650_add_english_language',1); INSERT INTO `migrations` VALUES (559,'2022_02_17_083521_update_order_status_to_orders_table',1); INSERT INTO `migrations` VALUES (560,'2022_02_18_102942_create_emergency_contacts_table',1); INSERT INTO `migrations` VALUES (561,'2022_02_21_061830_add_emergency_contact_module_and_permission',1); INSERT INTO `migrations` VALUES (562,'2022_02_22_170153_add_item_summary_column_credit_note',1); INSERT INTO `migrations` VALUES (563,'2022_02_24_070325_add_allowed_file_size_global',1); INSERT INTO `migrations` VALUES (564,'2022_02_25_095712_add_discout_to_orders_table',1); INSERT INTO `migrations` VALUES (565,'2022_03_01_173825_add_approve_expense_permission',1); INSERT INTO `migrations` VALUES (566,'2022_03_03_024807_modify_signature_column_on_proposal_signs_table',1); INSERT INTO `migrations` VALUES (567,'2022_03_04_055054_add_few_fields_in_lead_follow_up_table',1); INSERT INTO `migrations` VALUES (568,'2022_03_07_053249_add_flutterwave_webhook_secret_hash_to_payment_gateway_credentials_table',1); INSERT INTO `migrations` VALUES (569,'2022_03_08_063640_add_added_by_and_updated_by_columns_to_ticket_agent_groups_table',1); INSERT INTO `migrations` VALUES (570,'2022_03_09_060457_add_several_fields_to_lead_custom_forms_table',1); INSERT INTO `migrations` VALUES (571,'2022_03_10_094321_add_unassigned_task_permission',1); INSERT INTO `migrations` VALUES (572,'2022_03_15_104220_add_several_fields_to_invoice_settings_table',1); INSERT INTO `migrations` VALUES (573,'2022_03_16_060139_add_missing_hash_in_invoices_table',1); INSERT INTO `migrations` VALUES (574,'2022_03_16_093939_change_chat_length',1); INSERT INTO `migrations` VALUES (575,'2022_03_22_101553_remove_html_tags_in_products',1); INSERT INTO `migrations` VALUES (576,'2022_03_28_081634_create_ticket_email_settings_table',1); INSERT INTO `migrations` VALUES (577,'2022_03_30_075758_add_imap_columns_tickets_table',1); INSERT INTO `migrations` VALUES (578,'2022_04_06_050532_create_files_table',1); INSERT INTO `migrations` VALUES (579,'2022_04_11_094350_add_company_address_id_to_orders_table',1); INSERT INTO `migrations` VALUES (580,'2022_04_20_173756_change_milestone_cost_limit',1); INSERT INTO `migrations` VALUES (581,'2022_04_21_074927_add_currency_key_version_column',1); INSERT INTO `migrations` VALUES (582,'2022_04_22_054036_add_view_earning_permission_timelogs',1); INSERT INTO `migrations` VALUES (583,'2022_04_22_102709_create_employee_shifts_table',1); INSERT INTO `migrations` VALUES (584,'2022_04_25_085447_ad_missing_admin_permissions',1); INSERT INTO `migrations` VALUES (585,'2022_05_03_180927_add_soft_delete_tax',1); INSERT INTO `migrations` VALUES (586,'2022_05_04_060741_fix_delete_cacade_recur_invoice',1); INSERT INTO `migrations` VALUES (587,'2022_05_06_065647_create_employee_shift_change_requests_table',1); INSERT INTO `migrations` VALUES (588,'2022_05_06_100620_add_location_column_in_attendance',1); INSERT INTO `migrations` VALUES (589,'2022_05_17_095236_add_show_clock_in_button_in_attendace_table',1); INSERT INTO `migrations` VALUES (590,'2022_05_23_062159_add_project_show_in_invoice_setting_table',1); INSERT INTO `migrations` VALUES (591,'2022_05_25_064410_add_column_employee_details_table',1); INSERT INTO `migrations` VALUES (592,'2022_05_25_072526_add_custom_fields_id_to_lead_custom_form_table',1); INSERT INTO `migrations` VALUES (593,'2022_05_27_002220_add_custom_fields_id_to_ticket_custom_form_table',1); INSERT INTO `migrations` VALUES (594,'2022_05_31_070019_add_ticket_to_custom_field_groups',1); INSERT INTO `migrations` VALUES (595,'2022_06_09_114831_add_view_shift_roster_permission',1); INSERT INTO `migrations` VALUES (596,'2022_06_13_084344_add_google_calender_status_to_users_table',1); INSERT INTO `migrations` VALUES (597,'2022_06_20_102221_add_private_dashboard_type_to_dashboard_widgets_table',1); INSERT INTO `migrations` VALUES (598,'2022_06_20_102234_add_date_in_project_milestones_table',1); INSERT INTO `migrations` VALUES (599,'2022_06_20_202945_add_shift_time_columns_attendance_table',1); INSERT INTO `migrations` VALUES (600,'2022_06_21_051915_add_reminder_and_send_reminder_after_column_to_invoice_settings_table',1); INSERT INTO `migrations` VALUES (601,'2022_06_22_072625_add_shift_time_columns_employee_shift_schedule_table',1); INSERT INTO `migrations` VALUES (602,'2022_06_23_124453_add_default_status_in_calendar_view_employee_details_table',1); INSERT INTO `migrations` VALUES (603,'2022_06_24_084953_add_project_id_column_to_task_label_list',1); INSERT INTO `migrations` VALUES (604,'2022_06_28_045956_add_column_to_message_setting_table',1); INSERT INTO `migrations` VALUES (605,'2022_07_01_063756_add_app_name_column_organisation_settings_table',1); INSERT INTO `migrations` VALUES (606,'2022_07_01_111241_add_parent_id_column_to_teams',1); INSERT INTO `migrations` VALUES (607,'2022_07_04_092625_change_date_format_in_organization_setting_table',1); INSERT INTO `migrations` VALUES (608,'2022_07_11_051015_add_timelog_to_cutom_field_groups',1); INSERT INTO `migrations` VALUES (609,'2022_07_13_115914_add_remark_column_shift',1); INSERT INTO `migrations` VALUES (610,'2022_07_13_191406_add_custom_invoice_number_column_invoices',1); INSERT INTO `migrations` VALUES (611,'2022_07_14_203040_remove_dashboards_employee_type',1); INSERT INTO `migrations` VALUES (612,'2022_07_19_144705_add_week_timelog_widget_setting_private_dashboard',1); INSERT INTO `migrations` VALUES (613,'2022_07_22_073943_update_settings_add_license_type',1); INSERT INTO `migrations` VALUES (614,'2022_07_24_115433_add_expense_report_permission',1); INSERT INTO `migrations` VALUES (615,'2022_07_25_122923_add_task_soft_delete',1); INSERT INTO `migrations` VALUES (616,'2022_07_25_141508_add_today_attendance_widget_hr_dashbaord',1); INSERT INTO `migrations` VALUES (617,'2022_07_28_043824_add_export_column_custom_fields_table',1); INSERT INTO `migrations` VALUES (618,'2022_07_28_175448_create_knowledge_base_files_table',1); INSERT INTO `migrations` VALUES (619,'2022_07_29_101111_add_indexes_to_table_columns',1); INSERT INTO `migrations` VALUES (620,'2022_08_01_104602_add_columns_to_employee_details',1); INSERT INTO `migrations` VALUES (621,'2022_08_02_113623_add_external_link_column_knowledge_base_files_table',1); INSERT INTO `migrations` VALUES (622,'2022_08_02_121434_add_timestamps_knowledge_base_files_table',1); INSERT INTO `migrations` VALUES (623,'2022_08_03_103344_add_auto_clock_in_column_to_attendance_settings_table',1); INSERT INTO `migrations` VALUES (624,'2022_08_04_075744_add_approved_columns_on_leaves',1); INSERT INTO `migrations` VALUES (625,'2022_08_04_122512_add_columns_in_leave_types',1); INSERT INTO `migrations` VALUES (626,'2022_08_04_184937_add_half_day_type_in_leaves_table',1); INSERT INTO `migrations` VALUES (627,'2018_01_01_000000_create_worksuite_new_table',1);