diff --git a/app/Http/Controllers/MigrationController.php b/app/Http/Controllers/MigrationController.php index fab87c414d95..73268eb0caf3 100644 --- a/app/Http/Controllers/MigrationController.php +++ b/app/Http/Controllers/MigrationController.php @@ -181,7 +181,7 @@ class MigrationController extends BaseController $company->tasks()->forceDelete(); $company->vendors()->forceDelete(); $company->expenses()->forceDelete(); -// $company->bank_transaction_rules()->forceDelete(); + $company->bank_transaction_rules()->forceDelete(); $company->bank_transactions()->forceDelete(); $company->bank_integrations()->forceDelete(); diff --git a/app/Http/Requests/Subscription/StoreSubscriptionRequest.php b/app/Http/Requests/Subscription/StoreSubscriptionRequest.php index 441cdd755d18..2b0f9093b948 100644 --- a/app/Http/Requests/Subscription/StoreSubscriptionRequest.php +++ b/app/Http/Requests/Subscription/StoreSubscriptionRequest.php @@ -35,26 +35,34 @@ class StoreSubscriptionRequest extends Request public function rules() { $rules = [ - 'product_ids' => ['sometimes'], - 'recurring_product_ids' => ['sometimes'], - 'assigned_user_id' => ['sometimes'], - 'is_recurring' => ['sometimes'], - 'frequency_id' => ['required_with:recurring_product_ids'], - 'auto_bill' => ['sometimes'], - 'promo_code' => ['sometimes'], - 'promo_discount' => ['sometimes'], - 'is_amount_discount' => ['sometimes'], - 'allow_cancellation' => ['sometimes'], - 'per_set_enabled' => ['sometimes'], - 'min_seats_limit' => ['sometimes'], - 'max_seats_limit' => ['sometimes'], - 'trial_enabled' => ['sometimes'], - 'trial_duration' => ['sometimes'], - 'allow_query_overrides' => ['sometimes'], - 'allow_plan_changes' => ['sometimes'], - 'refund_period' => ['sometimes'], - 'webhook_configuration' => ['array'], 'name' => ['required', Rule::unique('subscriptions')->where('company_id', auth()->user()->company()->id)], + 'group_id' => ['bail','sometimes', 'nullable', Rule::exists('group_settings','id')->where('company_id', auth()->user()->company()->id)], + 'assigned_user_id' => ['bail','sometimes', 'nullable', Rule::exists('users','id')->where('account_id', auth()->user()->account_id)], + 'product_ids' => 'bail|sometimes|nullable|string', + 'recurring_product_ids' => 'bail|sometimes|nullable|string', + 'is_recurring' => 'bail|sometimes|bool', + 'frequency_id' => 'bail|required_with:recurring_product_ids', + 'auto_bill' => 'bail|sometimes|nullable|string', + 'promo_code' => 'bail|sometimes|nullable|string', + 'promo_discount' => 'bail|sometimes|numeric', + 'is_amount_discount' => 'bail|sometimes|bool', + 'allow_cancellation' => 'bail|sometimes|bool', + 'per_set_enabled' => 'bail|sometimes|bool', + 'min_seats_limit' => 'bail|sometimes|numeric', + 'max_seats_limit' => 'bail|sometimes|numeric', + 'trial_enabled' => 'bail|sometimes|bool', + 'trial_duration' => 'bail|sometimes|numeric', + 'allow_query_overrides' => 'bail|sometimes|bool', + 'allow_plan_changes' => 'bail|sometimes|bool', + 'refund_period' => 'bail|sometimes|numeric', + 'webhook_configuration' => 'bail|array', + 'webhook_configuration.post_purchase_url' => 'bail|sometimes|nullable|string', + 'webhook_configuration.post_purchase_rest_method' => 'bail|sometimes|nullable|string', + 'webhook_configuration.post_purchase_headers' => 'bail|sometimes|array', + 'registration_required' => 'bail|sometimes|bool', + 'optional_recurring_product_ids' => 'bail|sometimes|nullable|string', + 'optional_product_ids' => 'bail|sometimes|nullable|string', + 'use_inventory_management' => 'bail|sometimes|bool' ]; return $this->globalRules($rules); diff --git a/app/Http/Requests/Subscription/UpdateSubscriptionRequest.php b/app/Http/Requests/Subscription/UpdateSubscriptionRequest.php index 2b34f4fd61de..06f438a41102 100644 --- a/app/Http/Requests/Subscription/UpdateSubscriptionRequest.php +++ b/app/Http/Requests/Subscription/UpdateSubscriptionRequest.php @@ -37,26 +37,34 @@ class UpdateSubscriptionRequest extends Request public function rules() { $rules = [ - 'product_ids' => ['sometimes'], - 'recurring_product_ids' => ['sometimes'], - 'assigned_user_id' => ['sometimes'], - 'is_recurring' => ['sometimes'], - 'frequency_id' => ['required_with:recurring_product_ids'], - 'auto_bill' => ['sometimes'], - 'promo_code' => ['sometimes'], - 'promo_discount' => ['sometimes'], - 'is_amount_discount' => ['sometimes'], - 'allow_cancellation' => ['sometimes'], - 'per_set_enabled' => ['sometimes'], - 'min_seats_limit' => ['sometimes'], - 'max_seats_limit' => ['sometimes'], - 'trial_enabled' => ['sometimes'], - 'trial_duration' => ['sometimes'], - 'allow_query_overrides' => ['sometimes'], - 'allow_plan_changes' => ['sometimes'], - 'refund_period' => ['sometimes'], - 'webhook_configuration' => ['array'], - 'name' => ['sometimes', Rule::unique('subscriptions')->where('company_id', auth()->user()->company()->id)->ignore($this->subscription->id)], + 'name' => ['bail','sometimes', Rule::unique('subscriptions')->where('company_id', auth()->user()->company()->id)->ignore($this->subscription->id)], + 'group_id' => ['bail','sometimes', 'nullable', Rule::exists('group_settings','id')->where('company_id', auth()->user()->company()->id)], + 'assigned_user_id' => ['bail','sometimes', 'nullable', Rule::exists('users','id')->where('account_id', auth()->user()->account_id)], + 'product_ids' => 'bail|sometimes|nullable|string', + 'recurring_product_ids' => 'bail|sometimes|nullable|string', + 'is_recurring' => 'bail|sometimes|bool', + 'frequency_id' => 'bail|required_with:recurring_product_ids', + 'auto_bill' => 'bail|sometimes|nullable|string', + 'promo_code' => 'bail|sometimes|nullable|string', + 'promo_discount' => 'bail|sometimes|numeric', + 'is_amount_discount' => 'bail|sometimes|bool', + 'allow_cancellation' => 'bail|sometimes|bool', + 'per_set_enabled' => 'bail|sometimes|bool', + 'min_seats_limit' => 'bail|sometimes|numeric', + 'max_seats_limit' => 'bail|sometimes|numeric', + 'trial_enabled' => 'bail|sometimes|bool', + 'trial_duration' => 'bail|sometimes|numeric', + 'allow_query_overrides' => 'bail|sometimes|bool', + 'allow_plan_changes' => 'bail|sometimes|bool', + 'refund_period' => 'bail|sometimes|numeric', + 'webhook_configuration' => 'bail|array', + 'webhook_configuration.post_purchase_url' => 'bail|sometimes|nullable|string', + 'webhook_configuration.post_purchase_rest_method' => 'bail|sometimes|nullable|string', + 'webhook_configuration.post_purchase_headers' => 'bail|sometimes|array', + 'registration_required' => 'bail|sometimes|bool', + 'optional_recurring_product_ids' => 'bail|sometimes|nullable|string', + 'optional_product_ids' => 'bail|sometimes|nullable|string', + 'use_inventory_management' => 'bail|sometimes|bool', ]; return $this->globalRules($rules); diff --git a/app/Models/Subscription.php b/app/Models/Subscription.php index 41ac945b2866..0b75dad02c9b 100644 --- a/app/Models/Subscription.php +++ b/app/Models/Subscription.php @@ -57,6 +57,7 @@ class Subscription extends BaseModel 'registration_required', 'optional_product_ids', 'optional_recurring_product_ids', + 'use_inventory_management', ]; protected $casts = [ diff --git a/app/Transformers/SubscriptionTransformer.php b/app/Transformers/SubscriptionTransformer.php index 01580d27b48e..14649a31b072 100644 --- a/app/Transformers/SubscriptionTransformer.php +++ b/app/Transformers/SubscriptionTransformer.php @@ -68,6 +68,10 @@ class SubscriptionTransformer extends EntityTransformer 'updated_at' => (int) $subscription->updated_at, 'archived_at' => (int) $subscription->deleted_at, 'plan_map' => '', //@deprecated 03/04/2021 + 'use_inventory_management' => (bool) $subscription->use_inventory_management, + 'optional_recurring_product_ids' =>(string)$subscription->optional_recurring_product_ids, + 'optional_product_ids' => (string) $subscription->optional_product_ids, + 'registration_required' => (bool) $subscription->registration_required, ]; } } diff --git a/database/migrations/2022_11_22_215618_lock_tasks_when_invoiced.php b/database/migrations/2022_11_22_215618_lock_tasks_when_invoiced.php index 9a67fca92ccb..00c1925cb016 100644 --- a/database/migrations/2022_11_22_215618_lock_tasks_when_invoiced.php +++ b/database/migrations/2022_11_22_215618_lock_tasks_when_invoiced.php @@ -32,6 +32,7 @@ return new class extends Migration Schema::table('subscriptions', function (Blueprint $table) { $table->boolean('registration_required')->default(false); + $table->boolean('use_inventory_management')->default(false); $table->text('optional_product_ids')->nullable(); $table->text('optional_recurring_product_ids')->nullable(); diff --git a/database/schema/db-ninja-01-schema.dump b/database/schema/db-ninja-01-schema.dump index 0d2543573130..e311a8edc3c2 100644 --- a/database/schema/db-ninja-01-schema.dump +++ b/database/schema/db-ninja-01-schema.dump @@ -6,47 +6,48 @@ /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `accounts`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `accounts` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `plan` enum('pro','enterprise','white_label') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `plan_term` enum('month','year') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `plan` enum('pro','enterprise','white_label') DEFAULT NULL, + `plan_term` enum('month','year') DEFAULT NULL, `plan_started` date DEFAULT NULL, `plan_paid` date DEFAULT NULL, `plan_expires` date DEFAULT NULL, - `user_agent` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `key` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `payment_id` int unsigned DEFAULT NULL, - `default_company_id` int unsigned NOT NULL, + `user_agent` varchar(191) DEFAULT NULL, + `key` varchar(191) DEFAULT NULL, + `payment_id` int(10) unsigned DEFAULT NULL, + `default_company_id` int(10) unsigned NOT NULL, `trial_started` date DEFAULT NULL, - `trial_plan` enum('pro','enterprise') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `trial_plan` enum('pro','enterprise') DEFAULT NULL, `plan_price` decimal(7,2) DEFAULT NULL, - `num_users` smallint NOT NULL DEFAULT '1', - `utm_source` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `utm_medium` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `utm_campaign` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `utm_term` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `utm_content` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `latest_version` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0.0.0', - `report_errors` tinyint(1) NOT NULL DEFAULT '0', - `referral_code` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `num_users` smallint(6) NOT NULL DEFAULT 1, + `utm_source` varchar(191) DEFAULT NULL, + `utm_medium` varchar(191) DEFAULT NULL, + `utm_campaign` varchar(191) DEFAULT NULL, + `utm_term` varchar(191) DEFAULT NULL, + `utm_content` varchar(191) DEFAULT NULL, + `latest_version` varchar(191) NOT NULL DEFAULT '0.0.0', + `report_errors` tinyint(1) NOT NULL DEFAULT 0, + `referral_code` varchar(191) DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, - `is_scheduler_running` tinyint(1) NOT NULL DEFAULT '0', - `trial_duration` int unsigned DEFAULT NULL, - `is_onboarding` tinyint(1) NOT NULL DEFAULT '0', - `onboarding` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `is_migrated` tinyint(1) NOT NULL DEFAULT '0', - `platform` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `hosted_client_count` int unsigned DEFAULT NULL, - `hosted_company_count` int unsigned DEFAULT NULL, - `inapp_transaction_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `set_react_as_default_ap` tinyint(1) NOT NULL DEFAULT '0', - `is_flagged` tinyint(1) NOT NULL DEFAULT '0', - `is_verified_account` tinyint(1) NOT NULL DEFAULT '0', - `account_sms_verification_code` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `account_sms_verification_number` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `account_sms_verified` tinyint(1) NOT NULL DEFAULT '0', + `is_scheduler_running` tinyint(1) NOT NULL DEFAULT 0, + `trial_duration` int(10) unsigned DEFAULT NULL, + `is_onboarding` tinyint(1) NOT NULL DEFAULT 0, + `onboarding` mediumtext DEFAULT NULL, + `is_migrated` tinyint(1) NOT NULL DEFAULT 0, + `platform` varchar(128) DEFAULT NULL, + `hosted_client_count` int(10) unsigned DEFAULT NULL, + `hosted_company_count` int(10) unsigned DEFAULT NULL, + `inapp_transaction_id` varchar(100) DEFAULT NULL, + `set_react_as_default_ap` tinyint(1) NOT NULL DEFAULT 0, + `is_flagged` tinyint(1) NOT NULL DEFAULT 0, + `is_verified_account` tinyint(1) NOT NULL DEFAULT 0, + `account_sms_verification_code` text DEFAULT NULL, + `account_sms_verification_number` text DEFAULT NULL, + `account_sms_verified` tinyint(1) NOT NULL DEFAULT 0, + `bank_integration_account_id` text DEFAULT NULL, PRIMARY KEY (`id`), KEY `accounts_payment_id_index` (`payment_id`), KEY `accounts_key_index` (`key`) @@ -54,36 +55,36 @@ CREATE TABLE `accounts` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `activities`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `activities` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `user_id` int unsigned DEFAULT NULL, - `company_id` int unsigned NOT NULL, - `client_id` int unsigned DEFAULT NULL, - `client_contact_id` int unsigned DEFAULT NULL, - `account_id` int unsigned DEFAULT NULL, - `project_id` int unsigned DEFAULT NULL, - `vendor_id` int unsigned DEFAULT NULL, - `payment_id` int unsigned DEFAULT NULL, - `invoice_id` int unsigned DEFAULT NULL, - `credit_id` int unsigned DEFAULT NULL, - `invitation_id` int unsigned DEFAULT NULL, - `task_id` int unsigned DEFAULT NULL, - `expense_id` int unsigned DEFAULT NULL, - `activity_type_id` int unsigned DEFAULT NULL, - `ip` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `is_system` tinyint(1) NOT NULL DEFAULT '0', - `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `user_id` int(10) unsigned DEFAULT NULL, + `company_id` int(10) unsigned NOT NULL, + `client_id` int(10) unsigned DEFAULT NULL, + `client_contact_id` int(10) unsigned DEFAULT NULL, + `account_id` int(10) unsigned DEFAULT NULL, + `project_id` int(10) unsigned DEFAULT NULL, + `vendor_id` int(10) unsigned DEFAULT NULL, + `payment_id` int(10) unsigned DEFAULT NULL, + `invoice_id` int(10) unsigned DEFAULT NULL, + `credit_id` int(10) unsigned DEFAULT NULL, + `invitation_id` int(10) unsigned DEFAULT NULL, + `task_id` int(10) unsigned DEFAULT NULL, + `expense_id` int(10) unsigned DEFAULT NULL, + `activity_type_id` int(10) unsigned DEFAULT NULL, + `ip` varchar(191) NOT NULL, + `is_system` tinyint(1) NOT NULL DEFAULT 0, + `notes` text NOT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, - `token_id` int unsigned DEFAULT NULL, - `quote_id` int unsigned DEFAULT NULL, - `subscription_id` int unsigned DEFAULT NULL, - `recurring_invoice_id` int unsigned DEFAULT NULL, - `recurring_expense_id` int unsigned DEFAULT NULL, - `recurring_quote_id` int unsigned DEFAULT NULL, - `purchase_order_id` int unsigned DEFAULT NULL, - `vendor_contact_id` int unsigned DEFAULT NULL, + `token_id` int(10) unsigned DEFAULT NULL, + `quote_id` int(10) unsigned DEFAULT NULL, + `subscription_id` int(10) unsigned DEFAULT NULL, + `recurring_invoice_id` int(10) unsigned DEFAULT NULL, + `recurring_expense_id` int(10) unsigned DEFAULT NULL, + `recurring_quote_id` int(10) unsigned DEFAULT NULL, + `purchase_order_id` int(10) unsigned DEFAULT NULL, + `vendor_contact_id` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), KEY `activities_vendor_id_company_id_index` (`vendor_id`,`company_id`), KEY `activities_project_id_company_id_index` (`project_id`,`company_id`), @@ -106,16 +107,16 @@ CREATE TABLE `activities` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `backups`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `backups` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `activity_id` int unsigned NOT NULL, - `json_backup` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `html_backup` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `activity_id` int(10) unsigned NOT NULL, + `json_backup` mediumtext DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `amount` decimal(16,4) NOT NULL, - `filename` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `filename` text DEFAULT NULL, + `disk` varchar(191) DEFAULT NULL, PRIMARY KEY (`id`), KEY `backups_activity_id_foreign` (`activity_id`), CONSTRAINT `backups_activity_id_foreign` FOREIGN KEY (`activity_id`) REFERENCES `activities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE @@ -123,13 +124,13 @@ CREATE TABLE `backups` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `bank_companies`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `bank_companies` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `bank_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `username` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `bank_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `username` varchar(191) DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, @@ -142,17 +143,51 @@ CREATE TABLE `bank_companies` ( CONSTRAINT `bank_companies_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 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `bank_integrations`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `bank_integrations` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `account_id` int(10) unsigned NOT NULL, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `provider_name` text NOT NULL, + `provider_id` bigint(20) NOT NULL, + `bank_account_id` bigint(20) NOT NULL, + `bank_account_name` text DEFAULT NULL, + `bank_account_number` text DEFAULT NULL, + `bank_account_status` text DEFAULT NULL, + `bank_account_type` text DEFAULT NULL, + `balance` decimal(20,6) NOT NULL DEFAULT 0.000000, + `currency` text DEFAULT NULL, + `nickname` text NOT NULL DEFAULT '', + `from_date` date DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `created_at` timestamp(6) NULL DEFAULT NULL, + `updated_at` timestamp(6) NULL DEFAULT NULL, + `deleted_at` timestamp(6) NULL DEFAULT NULL, + `disabled_upstream` tinyint(1) NOT NULL DEFAULT 0, + `auto_sync` tinyint(1) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + KEY `bank_integrations_user_id_foreign` (`user_id`), + KEY `bank_integrations_account_id_foreign` (`account_id`), + KEY `bank_integrations_company_id_foreign` (`company_id`), + CONSTRAINT `bank_integrations_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `bank_integrations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `bank_integrations_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 ROW_FORMAT=DYNAMIC; +/*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `bank_subcompanies`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `bank_subcompanies` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `bank_company_id` int unsigned NOT NULL, - `account_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `website` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `account_number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `bank_company_id` int(10) unsigned NOT NULL, + `account_name` varchar(191) DEFAULT NULL, + `website` varchar(191) DEFAULT NULL, + `account_number` varchar(191) DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, @@ -165,53 +200,120 @@ CREATE TABLE `bank_subcompanies` ( CONSTRAINT `bank_subcompanies_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 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `bank_transaction_rules`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `bank_transaction_rules` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `name` varchar(191) NOT NULL, + `rules` mediumtext DEFAULT NULL, + `auto_convert` tinyint(1) NOT NULL DEFAULT 0, + `matches_on_all` tinyint(1) NOT NULL DEFAULT 0, + `applies_to` varchar(191) NOT NULL DEFAULT 'CREDIT', + `client_id` int(10) unsigned DEFAULT NULL, + `vendor_id` int(10) unsigned DEFAULT NULL, + `category_id` int(10) unsigned DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `created_at` timestamp(6) NULL DEFAULT NULL, + `updated_at` timestamp(6) NULL DEFAULT NULL, + `deleted_at` timestamp(6) NULL DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `bank_transaction_rules_user_id_foreign` (`user_id`), + KEY `bank_transaction_rules_company_id_foreign` (`company_id`), + CONSTRAINT `bank_transaction_rules_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `bank_transaction_rules_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 ROW_FORMAT=DYNAMIC; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `bank_transactions`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `bank_transactions` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `bank_integration_id` bigint(20) unsigned NOT NULL, + `transaction_id` bigint(20) unsigned NOT NULL, + `amount` decimal(20,6) NOT NULL DEFAULT 0.000000, + `currency_code` varchar(191) DEFAULT NULL, + `currency_id` int(10) unsigned DEFAULT NULL, + `account_type` varchar(191) DEFAULT NULL, + `category_id` int(10) unsigned DEFAULT NULL, + `ninja_category_id` int(10) unsigned DEFAULT NULL, + `category_type` varchar(191) NOT NULL, + `base_type` varchar(191) NOT NULL, + `date` date DEFAULT NULL, + `bank_account_id` bigint(20) unsigned NOT NULL, + `description` text DEFAULT NULL, + `invoice_ids` text NOT NULL DEFAULT '', + `expense_id` int(10) unsigned DEFAULT NULL, + `vendor_id` int(10) unsigned DEFAULT NULL, + `status_id` int(10) unsigned NOT NULL DEFAULT 1, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `created_at` timestamp(6) NULL DEFAULT NULL, + `updated_at` timestamp(6) NULL DEFAULT NULL, + `deleted_at` timestamp(6) NULL DEFAULT NULL, + `bank_rule_id` bigint(20) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `bank_transactions_bank_integration_id_foreign` (`bank_integration_id`), + KEY `bank_transactions_user_id_foreign` (`user_id`), + KEY `bank_transactions_company_id_foreign` (`company_id`), + KEY `bank_transactions_transaction_id_index` (`transaction_id`), + KEY `bank_transactions_category_type_index` (`category_type`), + KEY `bank_transactions_base_type_index` (`base_type`), + CONSTRAINT `bank_transactions_bank_integration_id_foreign` FOREIGN KEY (`bank_integration_id`) REFERENCES `bank_integrations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `bank_transactions_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `bank_transactions_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 ROW_FORMAT=DYNAMIC; +/*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `banks`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `banks` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `remote_id` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `bank_library_id` int NOT NULL DEFAULT '1', - `config` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(191) DEFAULT NULL, + `remote_id` varchar(191) DEFAULT NULL, + `bank_library_id` int(11) NOT NULL DEFAULT 1, + `config` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!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 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `client_contacts` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `client_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `first_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `last_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `phone` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `client_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `first_name` varchar(191) DEFAULT NULL, + `last_name` varchar(191) DEFAULT NULL, + `phone` varchar(191) DEFAULT NULL, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, + `email` varchar(100) DEFAULT NULL, `email_verified_at` timestamp NULL DEFAULT NULL, - `confirmation_code` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `is_primary` tinyint(1) NOT NULL DEFAULT '0', - `confirmed` tinyint(1) NOT NULL DEFAULT '0', + `confirmation_code` varchar(191) DEFAULT NULL, + `is_primary` tinyint(1) NOT NULL DEFAULT 0, + `confirmed` tinyint(1) NOT NULL DEFAULT 0, `last_login` timestamp NULL DEFAULT NULL, - `failed_logins` smallint DEFAULT NULL, - `oauth_user_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `oauth_provider_id` int unsigned DEFAULT NULL, - `google_2fa_secret` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `accepted_terms_version` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `avatar_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `avatar_size` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `password` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `token` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `is_locked` tinyint(1) NOT NULL DEFAULT '0', - `send_email` tinyint(1) NOT NULL DEFAULT '1', - `contact_key` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `remember_token` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `failed_logins` smallint(6) DEFAULT NULL, + `oauth_user_id` varchar(100) DEFAULT NULL, + `oauth_provider_id` int(10) unsigned DEFAULT NULL, + `google_2fa_secret` varchar(191) DEFAULT NULL, + `accepted_terms_version` varchar(191) DEFAULT NULL, + `avatar` varchar(255) DEFAULT NULL, + `avatar_type` varchar(255) DEFAULT NULL, + `avatar_size` varchar(255) DEFAULT NULL, + `password` varchar(191) NOT NULL, + `token` varchar(191) DEFAULT NULL, + `is_locked` tinyint(1) NOT NULL DEFAULT 0, + `send_email` tinyint(1) NOT NULL DEFAULT 1, + `contact_key` varchar(191) DEFAULT NULL, + `remember_token` varchar(100) DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, @@ -230,22 +332,22 @@ CREATE TABLE `client_contacts` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `client_gateway_tokens`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `client_gateway_tokens` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `client_id` int unsigned DEFAULT NULL, - `token` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `routing_number` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `company_gateway_id` int unsigned NOT NULL, - `gateway_customer_reference` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `gateway_type_id` int unsigned NOT NULL, - `is_default` tinyint(1) NOT NULL DEFAULT '0', - `meta` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `client_id` int(10) unsigned DEFAULT NULL, + `token` text DEFAULT NULL, + `routing_number` text DEFAULT NULL, + `company_gateway_id` int(10) unsigned NOT NULL, + `gateway_customer_reference` varchar(191) DEFAULT NULL, + `gateway_type_id` int(10) unsigned NOT NULL, + `is_default` tinyint(1) NOT NULL DEFAULT 0, + `meta` text DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `client_gateway_tokens_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `client_gateway_tokens_client_id_foreign` (`client_id`), @@ -255,21 +357,21 @@ CREATE TABLE `client_gateway_tokens` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `client_subscriptions`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `client_subscriptions` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `subscription_id` int unsigned NOT NULL, - `recurring_invoice_id` int unsigned DEFAULT NULL, - `client_id` int unsigned NOT NULL, - `trial_started` int unsigned DEFAULT NULL, - `trial_ends` int unsigned DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `subscription_id` int(10) unsigned NOT NULL, + `recurring_invoice_id` int(10) unsigned DEFAULT NULL, + `client_id` int(10) unsigned NOT NULL, + `trial_started` int(10) unsigned DEFAULT NULL, + `trial_ends` int(10) unsigned DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, `deleted_at` timestamp(6) NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, - `invoice_id` int unsigned DEFAULT NULL, - `quantity` int unsigned NOT NULL DEFAULT '1', + `invoice_id` int(10) unsigned DEFAULT NULL, + `quantity` int(10) unsigned NOT NULL DEFAULT 1, PRIMARY KEY (`id`), KEY `client_subscriptions_subscription_id_foreign` (`subscription_id`), KEY `client_subscriptions_recurring_invoice_id_foreign` (`recurring_invoice_id`), @@ -285,50 +387,50 @@ CREATE TABLE `client_subscriptions` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `clients`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `clients` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `assigned_user_id` int unsigned DEFAULT NULL, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `website` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `private_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `public_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `client_hash` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `logo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `balance` decimal(20,6) NOT NULL DEFAULT '0.000000', - `paid_to_date` decimal(20,6) NOT NULL DEFAULT '0.000000', - `credit_balance` decimal(20,6) NOT NULL DEFAULT '0.000000', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `assigned_user_id` int(10) unsigned DEFAULT NULL, + `name` varchar(191) DEFAULT NULL, + `website` varchar(191) DEFAULT NULL, + `private_notes` text DEFAULT NULL, + `public_notes` text DEFAULT NULL, + `client_hash` text DEFAULT NULL, + `logo` varchar(255) DEFAULT NULL, + `phone` varchar(255) DEFAULT NULL, + `balance` decimal(20,6) NOT NULL DEFAULT 0.000000, + `paid_to_date` decimal(20,6) NOT NULL DEFAULT 0.000000, + `credit_balance` decimal(20,6) NOT NULL DEFAULT 0.000000, `last_login` timestamp NULL DEFAULT NULL, - `industry_id` int unsigned DEFAULT NULL, - `size_id` int unsigned DEFAULT NULL, - `address1` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `address2` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `city` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `state` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `postal_code` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `country_id` int unsigned DEFAULT NULL, - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `shipping_address1` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `shipping_address2` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `shipping_city` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `shipping_state` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `shipping_postal_code` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `shipping_country_id` int unsigned DEFAULT NULL, - `settings` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `group_settings_id` int unsigned DEFAULT NULL, - `vat_number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `industry_id` int(10) unsigned DEFAULT NULL, + `size_id` int(10) unsigned DEFAULT NULL, + `address1` varchar(191) DEFAULT NULL, + `address2` varchar(191) DEFAULT NULL, + `city` varchar(191) DEFAULT NULL, + `state` varchar(191) DEFAULT NULL, + `postal_code` varchar(191) DEFAULT NULL, + `country_id` int(10) unsigned DEFAULT NULL, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, + `shipping_address1` varchar(191) DEFAULT NULL, + `shipping_address2` varchar(191) DEFAULT NULL, + `shipping_city` varchar(191) DEFAULT NULL, + `shipping_state` varchar(191) DEFAULT NULL, + `shipping_postal_code` varchar(191) DEFAULT NULL, + `shipping_country_id` int(10) unsigned DEFAULT NULL, + `settings` mediumtext DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `group_settings_id` int(10) unsigned DEFAULT NULL, + `vat_number` varchar(191) DEFAULT NULL, + `number` varchar(191) DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `id_number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `id_number` varchar(191) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `clients_company_id_number_unique` (`company_id`,`number`), KEY `clients_company_id_deleted_at_index` (`company_id`,`deleted_at`), @@ -344,78 +446,79 @@ CREATE TABLE `clients` ( /*!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 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `companies` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `account_id` int unsigned NOT NULL, - `industry_id` int unsigned DEFAULT NULL, - `ip` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `company_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `convert_products` tinyint(1) NOT NULL DEFAULT '0', - `fill_products` tinyint(1) NOT NULL DEFAULT '1', - `update_products` tinyint(1) NOT NULL DEFAULT '1', - `show_product_details` tinyint(1) NOT NULL DEFAULT '1', - `client_can_register` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_taxes1` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_taxes2` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_taxes3` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_taxes4` tinyint(1) NOT NULL DEFAULT '0', - `show_product_cost` tinyint(1) NOT NULL DEFAULT '0', - `enabled_tax_rates` int unsigned NOT NULL DEFAULT '0', - `enabled_modules` int unsigned NOT NULL DEFAULT '0', - `enable_product_cost` tinyint(1) NOT NULL DEFAULT '0', - `enable_product_quantity` tinyint(1) NOT NULL DEFAULT '1', - `default_quantity` tinyint(1) NOT NULL DEFAULT '1', - `subdomain` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `db` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `size_id` int unsigned DEFAULT NULL, - `first_day_of_week` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `first_month_of_year` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `portal_mode` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'subdomain', - `portal_domain` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `enable_modules` smallint NOT NULL DEFAULT '0', - `custom_fields` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `settings` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `slack_webhook_url` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `google_analytics_key` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `account_id` int(10) unsigned NOT NULL, + `industry_id` int(10) unsigned DEFAULT NULL, + `ip` varchar(191) DEFAULT NULL, + `company_key` varchar(100) NOT NULL, + `convert_products` tinyint(1) NOT NULL DEFAULT 0, + `fill_products` tinyint(1) NOT NULL DEFAULT 1, + `update_products` tinyint(1) NOT NULL DEFAULT 1, + `show_product_details` tinyint(1) NOT NULL DEFAULT 1, + `client_can_register` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_taxes1` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_taxes2` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_taxes3` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_taxes4` tinyint(1) NOT NULL DEFAULT 0, + `show_product_cost` tinyint(1) NOT NULL DEFAULT 0, + `enabled_tax_rates` int(10) unsigned NOT NULL DEFAULT 0, + `enabled_modules` int(10) unsigned NOT NULL DEFAULT 0, + `enable_product_cost` tinyint(1) NOT NULL DEFAULT 0, + `enable_product_quantity` tinyint(1) NOT NULL DEFAULT 1, + `default_quantity` tinyint(1) NOT NULL DEFAULT 1, + `subdomain` varchar(191) DEFAULT NULL, + `db` varchar(191) DEFAULT NULL, + `size_id` int(10) unsigned DEFAULT NULL, + `first_day_of_week` varchar(191) DEFAULT NULL, + `first_month_of_year` varchar(191) DEFAULT NULL, + `portal_mode` varchar(191) NOT NULL DEFAULT 'subdomain', + `portal_domain` varchar(191) DEFAULT NULL, + `enable_modules` smallint(6) NOT NULL DEFAULT 0, + `custom_fields` mediumtext NOT NULL, + `settings` mediumtext NOT NULL, + `slack_webhook_url` varchar(191) NOT NULL, + `google_analytics_key` varchar(191) NOT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, - `enabled_item_tax_rates` int NOT NULL DEFAULT '0', - `is_large` tinyint(1) NOT NULL DEFAULT '0', - `enable_shop_api` tinyint(1) NOT NULL DEFAULT '0', - `default_auto_bill` enum('off','always','optin','optout') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'off', - `mark_expenses_invoiceable` tinyint(1) NOT NULL DEFAULT '0', - `mark_expenses_paid` tinyint(1) NOT NULL DEFAULT '0', - `invoice_expense_documents` tinyint(1) NOT NULL DEFAULT '0', - `auto_start_tasks` tinyint(1) NOT NULL DEFAULT '0', - `invoice_task_timelog` tinyint(1) NOT NULL DEFAULT '1', - `invoice_task_documents` tinyint(1) NOT NULL DEFAULT '0', - `show_tasks_table` tinyint(1) NOT NULL DEFAULT '0', - `is_disabled` tinyint(1) NOT NULL DEFAULT '0', - `default_task_is_date_based` tinyint(1) NOT NULL DEFAULT '0', - `enable_product_discount` tinyint(1) NOT NULL DEFAULT '0', + `enabled_item_tax_rates` int(11) NOT NULL DEFAULT 0, + `is_large` tinyint(1) NOT NULL DEFAULT 0, + `enable_shop_api` tinyint(1) NOT NULL DEFAULT 0, + `default_auto_bill` enum('off','always','optin','optout') NOT NULL DEFAULT 'off', + `mark_expenses_invoiceable` tinyint(1) NOT NULL DEFAULT 0, + `mark_expenses_paid` tinyint(1) NOT NULL DEFAULT 0, + `invoice_expense_documents` tinyint(1) NOT NULL DEFAULT 0, + `auto_start_tasks` tinyint(1) NOT NULL DEFAULT 0, + `invoice_task_timelog` tinyint(1) NOT NULL DEFAULT 1, + `invoice_task_documents` tinyint(1) NOT NULL DEFAULT 0, + `show_tasks_table` tinyint(1) NOT NULL DEFAULT 0, + `is_disabled` tinyint(1) NOT NULL DEFAULT 0, + `default_task_is_date_based` tinyint(1) NOT NULL DEFAULT 0, + `enable_product_discount` tinyint(1) NOT NULL DEFAULT 0, `calculate_expense_tax_by_amount` tinyint(1) NOT NULL, - `expense_inclusive_taxes` tinyint(1) NOT NULL DEFAULT '0', - `session_timeout` int NOT NULL DEFAULT '0', - `oauth_password_required` tinyint(1) NOT NULL DEFAULT '0', - `invoice_task_datelog` tinyint(1) NOT NULL DEFAULT '1', - `default_password_timeout` int NOT NULL DEFAULT '30', - `show_task_end_date` tinyint(1) NOT NULL DEFAULT '0', - `markdown_enabled` tinyint(1) NOT NULL DEFAULT '1', - `use_comma_as_decimal_place` tinyint(1) NOT NULL DEFAULT '0', - `report_include_drafts` tinyint(1) NOT NULL DEFAULT '0', - `client_registration_fields` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `convert_rate_to_client` tinyint(1) NOT NULL DEFAULT '1', - `markdown_email_enabled` tinyint(1) NOT NULL DEFAULT '0', - `stop_on_unpaid_recurring` tinyint(1) NOT NULL DEFAULT '0', - `use_quote_terms_on_conversion` tinyint(1) NOT NULL DEFAULT '0', - `enable_applying_payments` tinyint(1) NOT NULL DEFAULT '0', - `track_inventory` tinyint(1) NOT NULL DEFAULT '0', - `inventory_notification_threshold` int NOT NULL DEFAULT '0', - `stock_notification` tinyint(1) NOT NULL DEFAULT '1', - `enabled_expense_tax_rates` int unsigned NOT NULL DEFAULT '0', - `invoice_task_project` tinyint(1) NOT NULL DEFAULT '0', - `report_include_deleted` tinyint(1) NOT NULL DEFAULT '0', + `expense_inclusive_taxes` tinyint(1) NOT NULL DEFAULT 0, + `session_timeout` int(11) NOT NULL DEFAULT 0, + `oauth_password_required` tinyint(1) NOT NULL DEFAULT 0, + `invoice_task_datelog` tinyint(1) NOT NULL DEFAULT 1, + `default_password_timeout` int(11) NOT NULL DEFAULT 30, + `show_task_end_date` tinyint(1) NOT NULL DEFAULT 0, + `markdown_enabled` tinyint(1) NOT NULL DEFAULT 1, + `use_comma_as_decimal_place` tinyint(1) NOT NULL DEFAULT 0, + `report_include_drafts` tinyint(1) NOT NULL DEFAULT 0, + `client_registration_fields` mediumtext DEFAULT NULL, + `convert_rate_to_client` tinyint(1) NOT NULL DEFAULT 1, + `markdown_email_enabled` tinyint(1) NOT NULL DEFAULT 0, + `stop_on_unpaid_recurring` tinyint(1) NOT NULL DEFAULT 0, + `use_quote_terms_on_conversion` tinyint(1) NOT NULL DEFAULT 0, + `enable_applying_payments` tinyint(1) NOT NULL DEFAULT 0, + `track_inventory` tinyint(1) NOT NULL DEFAULT 0, + `inventory_notification_threshold` int(11) NOT NULL DEFAULT 0, + `stock_notification` tinyint(1) NOT NULL DEFAULT 1, + `enabled_expense_tax_rates` int(10) unsigned NOT NULL DEFAULT 0, + `invoice_task_project` tinyint(1) NOT NULL DEFAULT 0, + `report_include_deleted` tinyint(1) NOT NULL DEFAULT 0, + `invoice_task_lock` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), UNIQUE KEY `companies_company_key_unique` (`company_key`), KEY `companies_industry_id_foreign` (`industry_id`), @@ -431,34 +534,34 @@ CREATE TABLE `companies` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `company_gateways`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `company_gateways` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `gateway_key` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `accepted_credit_cards` int unsigned NOT NULL, - `require_cvv` tinyint(1) NOT NULL DEFAULT '1', - `require_billing_address` tinyint(1) DEFAULT '1', - `require_shipping_address` tinyint(1) DEFAULT '1', - `update_details` tinyint(1) DEFAULT '0', - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `config` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `fees_and_limits` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `custom_value1` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `gateway_key` varchar(191) NOT NULL, + `accepted_credit_cards` int(10) unsigned NOT NULL, + `require_cvv` tinyint(1) NOT NULL DEFAULT 1, + `require_billing_address` tinyint(1) DEFAULT 1, + `require_shipping_address` tinyint(1) DEFAULT 1, + `update_details` tinyint(1) DEFAULT 0, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `config` mediumtext NOT NULL, + `fees_and_limits` text NOT NULL, + `custom_value1` varchar(191) DEFAULT NULL, + `custom_value2` varchar(191) DEFAULT NULL, + `custom_value3` varchar(191) DEFAULT NULL, + `custom_value4` varchar(191) DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `token_billing` enum('off','always','optin','optout') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'off', - `label` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `require_client_name` tinyint(1) NOT NULL DEFAULT '0', - `require_postal_code` tinyint(1) NOT NULL DEFAULT '0', - `require_client_phone` tinyint(1) NOT NULL DEFAULT '0', - `require_contact_name` tinyint(1) NOT NULL DEFAULT '0', - `require_contact_email` tinyint(1) NOT NULL DEFAULT '0', + `token_billing` enum('off','always','optin','optout') NOT NULL DEFAULT 'off', + `label` varchar(255) DEFAULT NULL, + `require_client_name` tinyint(1) NOT NULL DEFAULT 0, + `require_postal_code` tinyint(1) NOT NULL DEFAULT 0, + `require_client_phone` tinyint(1) NOT NULL DEFAULT 0, + `require_contact_name` tinyint(1) NOT NULL DEFAULT 0, + `require_contact_email` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `company_gateways_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `company_gateways_gateway_key_foreign` (`gateway_key`), @@ -470,19 +573,19 @@ CREATE TABLE `company_gateways` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `company_ledgers`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `company_ledgers` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `client_id` int unsigned DEFAULT NULL, - `user_id` int unsigned DEFAULT NULL, - `activity_id` int unsigned DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `client_id` int(10) unsigned DEFAULT NULL, + `user_id` int(10) unsigned DEFAULT NULL, + `activity_id` int(10) unsigned DEFAULT NULL, `adjustment` decimal(20,6) DEFAULT NULL, `balance` decimal(20,6) DEFAULT NULL, - `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `hash` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `company_ledgerable_id` int unsigned NOT NULL, - `company_ledgerable_type` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `notes` text DEFAULT NULL, + `hash` text DEFAULT NULL, + `company_ledgerable_id` int(10) unsigned NOT NULL, + `company_ledgerable_type` varchar(191) NOT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, PRIMARY KEY (`id`), @@ -494,24 +597,25 @@ CREATE TABLE `company_ledgers` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `company_tokens`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `company_tokens` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `account_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `token` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `account_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `token` varchar(191) DEFAULT NULL, + `name` varchar(191) DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `is_system` tinyint(1) NOT NULL DEFAULT '0', + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `is_system` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `company_tokens_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `company_tokens_account_id_foreign` (`account_id`), KEY `company_tokens_user_id_foreign` (`user_id`), KEY `company_tokens_company_id_index` (`company_id`), + KEY `company_tokens_token_deleted_at_index` (`token`,`deleted_at`), CONSTRAINT `company_tokens_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `company_tokens_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `company_tokens_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE @@ -519,24 +623,24 @@ CREATE TABLE `company_tokens` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `company_user`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `company_user` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `account_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `permissions` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `notifications` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `settings` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `slack_webhook_url` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `is_owner` tinyint(1) NOT NULL DEFAULT '0', - `is_admin` tinyint(1) NOT NULL DEFAULT '0', - `is_locked` tinyint(1) NOT NULL DEFAULT '0', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `account_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `permissions` mediumtext DEFAULT NULL, + `notifications` mediumtext DEFAULT NULL, + `settings` mediumtext DEFAULT NULL, + `slack_webhook_url` varchar(191) NOT NULL, + `is_owner` tinyint(1) NOT NULL DEFAULT 0, + `is_admin` tinyint(1) NOT NULL DEFAULT 0, + `is_locked` tinyint(1) NOT NULL DEFAULT 0, `deleted_at` timestamp(6) NULL DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, - `permissions_updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `ninja_portal_url` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `permissions_updated_at` timestamp NOT NULL DEFAULT current_timestamp(), + `ninja_portal_url` text NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `company_user_company_id_user_id_unique` (`company_id`,`user_id`), KEY `company_user_account_id_company_id_deleted_at_index` (`account_id`,`company_id`,`deleted_at`), @@ -547,43 +651,43 @@ CREATE TABLE `company_user` ( /*!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 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `countries` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `capital` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `citizenship` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `country_code` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `currency` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `currency_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `currency_sub_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `full_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `iso_3166_2` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `iso_3166_3` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `region_code` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `sub_region_code` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `eea` tinyint(1) NOT NULL DEFAULT '0', - `swap_postal_code` tinyint(1) NOT NULL DEFAULT '0', - `swap_currency_symbol` tinyint(1) NOT NULL DEFAULT '0', - `thousand_separator` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `decimal_separator` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `capital` varchar(255) DEFAULT NULL, + `citizenship` varchar(255) DEFAULT NULL, + `country_code` varchar(3) DEFAULT NULL, + `currency` varchar(255) DEFAULT NULL, + `currency_code` varchar(255) DEFAULT NULL, + `currency_sub_unit` varchar(255) DEFAULT NULL, + `full_name` varchar(255) DEFAULT NULL, + `iso_3166_2` varchar(2) DEFAULT NULL, + `iso_3166_3` varchar(3) DEFAULT NULL, + `name` varchar(255) DEFAULT NULL, + `region_code` varchar(3) DEFAULT NULL, + `sub_region_code` varchar(3) DEFAULT NULL, + `eea` tinyint(1) NOT NULL DEFAULT 0, + `swap_postal_code` tinyint(1) NOT NULL DEFAULT 0, + `swap_currency_symbol` tinyint(1) NOT NULL DEFAULT 0, + `thousand_separator` varchar(191) DEFAULT NULL, + `decimal_separator` varchar(191) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `credit_invitations`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `credit_invitations` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `client_contact_id` int unsigned NOT NULL, - `credit_id` int unsigned NOT NULL, - `key` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `transaction_reference` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `message_id` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email_error` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `signature_base64` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `client_contact_id` int(10) unsigned NOT NULL, + `credit_id` int(10) unsigned NOT NULL, + `key` varchar(191) NOT NULL, + `transaction_reference` varchar(191) DEFAULT NULL, + `message_id` varchar(191) DEFAULT NULL, + `email_error` mediumtext DEFAULT NULL, + `signature_base64` text DEFAULT NULL, `signature_date` datetime DEFAULT NULL, `sent_date` datetime DEFAULT NULL, `viewed_date` datetime DEFAULT NULL, @@ -591,8 +695,8 @@ CREATE TABLE `credit_invitations` ( `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `signature_ip` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `email_status` enum('delivered','bounced','spam') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `signature_ip` text DEFAULT NULL, + `email_status` enum('delivered','bounced','spam') DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `credit_invitations_client_contact_id_credit_id_unique` (`client_contact_id`,`credit_id`), KEY `credit_invitations_user_id_foreign` (`user_id`), @@ -608,55 +712,55 @@ CREATE TABLE `credit_invitations` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `credits`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `credits` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `client_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `assigned_user_id` int unsigned DEFAULT NULL, - `company_id` int unsigned NOT NULL, - `status_id` int unsigned NOT NULL, - `project_id` int unsigned DEFAULT NULL, - `vendor_id` int unsigned DEFAULT NULL, - `recurring_id` int unsigned DEFAULT NULL, - `design_id` int unsigned DEFAULT NULL, - `invoice_id` int unsigned DEFAULT NULL, - `number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `discount` double(8,2) NOT NULL DEFAULT '0.00', - `is_amount_discount` tinyint(1) NOT NULL DEFAULT '0', - `po_number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `client_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `assigned_user_id` int(10) unsigned DEFAULT NULL, + `company_id` int(10) unsigned NOT NULL, + `status_id` int(10) unsigned NOT NULL, + `project_id` int(10) unsigned DEFAULT NULL, + `vendor_id` int(10) unsigned DEFAULT NULL, + `recurring_id` int(10) unsigned DEFAULT NULL, + `design_id` int(10) unsigned DEFAULT NULL, + `invoice_id` int(10) unsigned DEFAULT NULL, + `number` varchar(191) DEFAULT NULL, + `discount` double(8,2) NOT NULL DEFAULT 0.00, + `is_amount_discount` tinyint(1) NOT NULL DEFAULT 0, + `po_number` varchar(191) DEFAULT NULL, `date` date DEFAULT NULL, `last_sent_date` datetime DEFAULT NULL, `due_date` date DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `line_items` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `backup` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `footer` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `public_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `private_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `terms` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `tax_name1` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate1` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name2` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate2` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name3` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate3` decimal(20,6) NOT NULL DEFAULT '0.000000', - `total_taxes` decimal(20,6) NOT NULL DEFAULT '0.000000', - `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT '0', - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `line_items` mediumtext DEFAULT NULL, + `backup` mediumtext DEFAULT NULL, + `footer` text DEFAULT NULL, + `public_notes` text DEFAULT NULL, + `private_notes` text DEFAULT NULL, + `terms` text DEFAULT NULL, + `tax_name1` varchar(191) DEFAULT NULL, + `tax_rate1` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name2` varchar(191) DEFAULT NULL, + `tax_rate2` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name3` varchar(191) DEFAULT NULL, + `tax_rate3` decimal(20,6) NOT NULL DEFAULT 0.000000, + `total_taxes` decimal(20,6) NOT NULL DEFAULT 0.000000, + `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT 0, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, `next_send_date` datetime DEFAULT NULL, `custom_surcharge1` decimal(20,6) DEFAULT NULL, `custom_surcharge2` decimal(20,6) DEFAULT NULL, `custom_surcharge3` decimal(20,6) DEFAULT NULL, `custom_surcharge4` decimal(20,6) DEFAULT NULL, - `custom_surcharge_tax1` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax2` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax3` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax4` tinyint(1) NOT NULL DEFAULT '0', - `exchange_rate` decimal(20,6) NOT NULL DEFAULT '1.000000', + `custom_surcharge_tax1` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax2` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax3` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax4` tinyint(1) NOT NULL DEFAULT 0, + `exchange_rate` decimal(20,6) NOT NULL DEFAULT 1.000000, `amount` decimal(20,6) NOT NULL, `balance` decimal(20,6) NOT NULL, `partial` decimal(20,6) DEFAULT NULL, @@ -669,8 +773,8 @@ CREATE TABLE `credits` ( `reminder2_sent` date DEFAULT NULL, `reminder3_sent` date DEFAULT NULL, `reminder_last_sent` date DEFAULT NULL, - `paid_to_date` decimal(20,6) NOT NULL DEFAULT '0.000000', - `subscription_id` int unsigned DEFAULT NULL, + `paid_to_date` decimal(20,6) NOT NULL DEFAULT 0.000000, + `subscription_id` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `credits_company_id_number_unique` (`company_id`,`number`), KEY `credits_user_id_foreign` (`user_id`), @@ -684,54 +788,54 @@ CREATE TABLE `credits` ( /*!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 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `currencies` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `symbol` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `precision` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `thousand_separator` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `decimal_separator` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `code` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `swap_currency_symbol` tinyint(1) NOT NULL DEFAULT '0', - `exchange_rate` decimal(13,6) NOT NULL DEFAULT '1.000000', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(191) NOT NULL, + `symbol` varchar(191) NOT NULL, + `precision` varchar(191) NOT NULL, + `thousand_separator` varchar(191) NOT NULL, + `decimal_separator` varchar(191) NOT NULL, + `code` varchar(191) NOT NULL, + `swap_currency_symbol` tinyint(1) NOT NULL DEFAULT 0, + `exchange_rate` decimal(13,6) NOT NULL DEFAULT 1.000000, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `date_formats`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `date_formats` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `format` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `format_moment` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `format_dart` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `format` varchar(191) NOT NULL, + `format_moment` varchar(191) NOT NULL, + `format_dart` varchar(191) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `datetime_formats`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `datetime_formats` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `format` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `format_moment` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `format_dart` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `format` varchar(191) NOT NULL, + `format_moment` varchar(191) NOT NULL, + `format_dart` varchar(191) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `designs`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `designs` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `user_id` int unsigned DEFAULT NULL, - `company_id` int unsigned DEFAULT NULL, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `is_custom` tinyint(1) NOT NULL DEFAULT '1', - `is_active` tinyint(1) NOT NULL DEFAULT '1', - `design` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `user_id` int(10) unsigned DEFAULT NULL, + `company_id` int(10) unsigned DEFAULT NULL, + `name` varchar(191) NOT NULL, + `is_custom` tinyint(1) NOT NULL DEFAULT 1, + `is_active` tinyint(1) NOT NULL DEFAULT 1, + `design` mediumtext DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, @@ -743,52 +847,54 @@ CREATE TABLE `designs` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `documents`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `documents` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `user_id` int unsigned NOT NULL, - `assigned_user_id` int unsigned DEFAULT NULL, - `company_id` int unsigned NOT NULL, - `project_id` int unsigned DEFAULT NULL, - `vendor_id` int unsigned DEFAULT NULL, - `url` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `preview` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `type` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `disk` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `hash` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `size` int unsigned DEFAULT NULL, - `width` int unsigned DEFAULT NULL, - `height` int unsigned DEFAULT NULL, - `is_default` tinyint(1) NOT NULL DEFAULT '0', - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `user_id` int(10) unsigned NOT NULL, + `assigned_user_id` int(10) unsigned DEFAULT NULL, + `company_id` int(10) unsigned NOT NULL, + `project_id` int(10) unsigned DEFAULT NULL, + `vendor_id` int(10) unsigned DEFAULT NULL, + `url` varchar(191) DEFAULT NULL, + `preview` varchar(191) DEFAULT NULL, + `name` varchar(191) DEFAULT NULL, + `type` varchar(191) DEFAULT NULL, + `disk` varchar(191) DEFAULT NULL, + `hash` varchar(100) DEFAULT NULL, + `size` int(10) unsigned DEFAULT NULL, + `width` int(10) unsigned DEFAULT NULL, + `height` int(10) unsigned DEFAULT NULL, + `is_default` tinyint(1) NOT NULL DEFAULT 0, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `documentable_id` int unsigned NOT NULL, - `documentable_type` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `documentable_id` int(10) unsigned NOT NULL, + `documentable_type` varchar(191) NOT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, - `is_public` tinyint(1) NOT NULL DEFAULT '1', + `is_public` tinyint(1) NOT NULL DEFAULT 1, PRIMARY KEY (`id`), KEY `documents_company_id_index` (`company_id`), + KEY `documents_documentable_id_documentable_type_deleted_at_index` (`documentable_id`,`documentable_type`,`deleted_at`), CONSTRAINT `documents_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 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `expense_categories`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `expense_categories` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `user_id` int unsigned NOT NULL, - `company_id` int unsigned NOT NULL, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `user_id` int(10) unsigned NOT NULL, + `company_id` int(10) unsigned NOT NULL, + `name` varchar(191) DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `color` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#fff', + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `color` varchar(191) NOT NULL DEFAULT '#fff', + `bank_category_id` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), KEY `expense_categories_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `expense_categories_company_id_index` (`company_id`), @@ -797,101 +903,102 @@ CREATE TABLE `expense_categories` ( /*!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 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `expenses` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, - `company_id` int unsigned NOT NULL, - `vendor_id` int unsigned DEFAULT NULL, - `user_id` int unsigned NOT NULL, - `assigned_user_id` int unsigned DEFAULT NULL, - `invoice_id` int unsigned DEFAULT NULL, - `client_id` int unsigned DEFAULT NULL, - `bank_id` int unsigned DEFAULT NULL, - `invoice_currency_id` int unsigned DEFAULT NULL, - `currency_id` int unsigned DEFAULT NULL, - `category_id` int unsigned DEFAULT NULL, - `payment_type_id` int unsigned DEFAULT NULL, - `recurring_expense_id` int unsigned DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `company_id` int(10) unsigned NOT NULL, + `vendor_id` int(10) unsigned DEFAULT NULL, + `user_id` int(10) unsigned NOT NULL, + `assigned_user_id` int(10) unsigned DEFAULT NULL, + `invoice_id` int(10) unsigned DEFAULT NULL, + `client_id` int(10) unsigned DEFAULT NULL, + `bank_id` int(10) unsigned DEFAULT NULL, + `invoice_currency_id` int(10) unsigned DEFAULT NULL, + `currency_id` int(10) unsigned DEFAULT NULL, + `category_id` int(10) unsigned DEFAULT NULL, + `payment_type_id` int(10) unsigned DEFAULT NULL, + `recurring_expense_id` int(10) unsigned DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, `amount` decimal(20,6) NOT NULL, `foreign_amount` decimal(20,6) NOT NULL, - `exchange_rate` decimal(20,6) NOT NULL DEFAULT '1.000000', - `tax_name1` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate1` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name2` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate2` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name3` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate3` decimal(20,6) NOT NULL DEFAULT '0.000000', + `exchange_rate` decimal(20,6) NOT NULL DEFAULT 1.000000, + `tax_name1` varchar(191) DEFAULT NULL, + `tax_rate1` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name2` varchar(191) DEFAULT NULL, + `tax_rate2` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name3` varchar(191) DEFAULT NULL, + `tax_rate3` decimal(20,6) NOT NULL DEFAULT 0.000000, `date` date DEFAULT NULL, `payment_date` date DEFAULT NULL, - `private_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `public_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `transaction_reference` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `should_be_invoiced` tinyint(1) NOT NULL DEFAULT '0', - `invoice_documents` tinyint(1) NOT NULL DEFAULT '1', - `transaction_id` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `project_id` int unsigned DEFAULT NULL, - `tax_amount1` decimal(20,6) NOT NULL DEFAULT '1.000000', - `tax_amount2` decimal(20,6) NOT NULL DEFAULT '1.000000', - `tax_amount3` decimal(20,6) NOT NULL DEFAULT '1.000000', - `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT '0', - `calculate_tax_by_amount` tinyint(1) NOT NULL DEFAULT '0', + `private_notes` text DEFAULT NULL, + `public_notes` text DEFAULT NULL, + `transaction_reference` text DEFAULT NULL, + `should_be_invoiced` tinyint(1) NOT NULL DEFAULT 0, + `invoice_documents` tinyint(1) NOT NULL DEFAULT 1, + `transaction_id` bigint(20) unsigned DEFAULT NULL, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, + `number` varchar(191) DEFAULT NULL, + `project_id` int(10) unsigned DEFAULT NULL, + `tax_amount1` decimal(20,6) NOT NULL DEFAULT 1.000000, + `tax_amount2` decimal(20,6) NOT NULL DEFAULT 1.000000, + `tax_amount3` decimal(20,6) NOT NULL DEFAULT 1.000000, + `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT 0, + `calculate_tax_by_amount` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `expenses_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `expenses_user_id_foreign` (`user_id`), KEY `expenses_company_id_index` (`company_id`), + KEY `expenses_invoice_id_deleted_at_index` (`invoice_id`,`deleted_at`), CONSTRAINT `expenses_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE 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 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!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 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `failed_jobs` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT, - `uuid` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `connection` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `queue` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `exception` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `uuid` varchar(191) DEFAULT NULL, + `connection` text NOT NULL, + `queue` text NOT NULL, + `payload` longtext NOT NULL, + `exception` longtext 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 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `gateway_types`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `gateway_types` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `alias` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `alias` varchar(191) DEFAULT NULL, + `name` varchar(191) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `gateways`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `gateways` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `key` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `provider` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `visible` tinyint(1) NOT NULL DEFAULT '1', - `sort_order` int unsigned NOT NULL DEFAULT '10000', - `site_url` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `is_offsite` tinyint(1) NOT NULL DEFAULT '0', - `is_secure` tinyint(1) NOT NULL DEFAULT '0', - `fields` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `default_gateway_type_id` int unsigned NOT NULL DEFAULT '1', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(191) NOT NULL, + `key` varchar(191) NOT NULL, + `provider` varchar(191) NOT NULL, + `visible` tinyint(1) NOT NULL DEFAULT 1, + `sort_order` int(10) unsigned NOT NULL DEFAULT 10000, + `site_url` varchar(200) DEFAULT NULL, + `is_offsite` tinyint(1) NOT NULL DEFAULT 0, + `is_secure` tinyint(1) NOT NULL DEFAULT 0, + `fields` longtext DEFAULT NULL, + `default_gateway_type_id` int(10) unsigned NOT NULL DEFAULT 1, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, PRIMARY KEY (`id`), @@ -900,18 +1007,18 @@ CREATE TABLE `gateways` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `group_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `group_settings` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `user_id` int unsigned DEFAULT NULL, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `settings` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `is_default` tinyint(1) NOT NULL DEFAULT '0', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned DEFAULT NULL, + `name` varchar(191) DEFAULT NULL, + `settings` mediumtext DEFAULT NULL, + `is_default` tinyint(1) NOT NULL DEFAULT 0, `deleted_at` timestamp(6) NULL DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `group_settings_company_id_deleted_at_index` (`company_id`,`deleted_at`), CONSTRAINT `group_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE @@ -919,27 +1026,27 @@ CREATE TABLE `group_settings` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `industries`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `industries` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(191) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `invoice_invitations`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `invoice_invitations` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `client_contact_id` int unsigned NOT NULL, - `invoice_id` int unsigned NOT NULL, - `key` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `transaction_reference` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `message_id` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email_error` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `signature_base64` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `client_contact_id` int(10) unsigned NOT NULL, + `invoice_id` int(10) unsigned NOT NULL, + `key` varchar(191) NOT NULL, + `transaction_reference` varchar(191) DEFAULT NULL, + `message_id` varchar(191) DEFAULT NULL, + `email_error` mediumtext DEFAULT NULL, + `signature_base64` text DEFAULT NULL, `signature_date` datetime DEFAULT NULL, `sent_date` datetime DEFAULT NULL, `viewed_date` datetime DEFAULT NULL, @@ -947,15 +1054,15 @@ CREATE TABLE `invoice_invitations` ( `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `signature_ip` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `email_status` enum('delivered','bounced','spam') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `signature_ip` text DEFAULT NULL, + `email_status` enum('delivered','bounced','spam') DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `invoice_invitations_client_contact_id_invoice_id_unique` (`client_contact_id`,`invoice_id`), KEY `invoice_invitations_user_id_foreign` (`user_id`), KEY `invoice_invitations_company_id_foreign` (`company_id`), KEY `invoice_invitations_deleted_at_invoice_id_company_id_index` (`deleted_at`,`invoice_id`,`company_id`), KEY `invoice_invitations_invoice_id_index` (`invoice_id`), - KEY `invoice_invitations_key_index` (`key`), + KEY `invoice_invitations_key_deleted_at_index` (`key`,`deleted_at`), CONSTRAINT `invoice_invitations_client_contact_id_foreign` FOREIGN KEY (`client_contact_id`) REFERENCES `client_contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoice_invitations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoice_invitations_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, @@ -964,54 +1071,54 @@ CREATE TABLE `invoice_invitations` ( /*!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 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `invoices` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `client_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `assigned_user_id` int unsigned DEFAULT NULL, - `company_id` int unsigned NOT NULL, - `status_id` int unsigned NOT NULL, - `project_id` int unsigned DEFAULT NULL, - `vendor_id` int unsigned DEFAULT NULL, - `recurring_id` int unsigned DEFAULT NULL, - `design_id` int unsigned DEFAULT NULL, - `number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `discount` double(8,2) NOT NULL DEFAULT '0.00', - `is_amount_discount` tinyint(1) NOT NULL DEFAULT '0', - `po_number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `client_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `assigned_user_id` int(10) unsigned DEFAULT NULL, + `company_id` int(10) unsigned NOT NULL, + `status_id` int(10) unsigned NOT NULL, + `project_id` int(10) unsigned DEFAULT NULL, + `vendor_id` int(10) unsigned DEFAULT NULL, + `recurring_id` int(10) unsigned DEFAULT NULL, + `design_id` int(10) unsigned DEFAULT NULL, + `number` varchar(191) DEFAULT NULL, + `discount` double(8,2) NOT NULL DEFAULT 0.00, + `is_amount_discount` tinyint(1) NOT NULL DEFAULT 0, + `po_number` varchar(191) DEFAULT NULL, `date` date DEFAULT NULL, `last_sent_date` date DEFAULT NULL, `due_date` datetime DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `line_items` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `backup` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `footer` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `public_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `private_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `terms` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `tax_name1` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate1` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name2` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate2` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name3` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate3` decimal(20,6) NOT NULL DEFAULT '0.000000', - `total_taxes` decimal(20,6) NOT NULL DEFAULT '0.000000', - `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT '0', - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `line_items` mediumtext DEFAULT NULL, + `backup` mediumtext DEFAULT NULL, + `footer` text DEFAULT NULL, + `public_notes` text DEFAULT NULL, + `private_notes` text DEFAULT NULL, + `terms` text DEFAULT NULL, + `tax_name1` varchar(191) DEFAULT NULL, + `tax_rate1` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name2` varchar(191) DEFAULT NULL, + `tax_rate2` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name3` varchar(191) DEFAULT NULL, + `tax_rate3` decimal(20,6) NOT NULL DEFAULT 0.000000, + `total_taxes` decimal(20,6) NOT NULL DEFAULT 0.000000, + `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT 0, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, `next_send_date` datetime DEFAULT NULL, `custom_surcharge1` decimal(20,6) DEFAULT NULL, `custom_surcharge2` decimal(20,6) DEFAULT NULL, `custom_surcharge3` decimal(20,6) DEFAULT NULL, `custom_surcharge4` decimal(20,6) DEFAULT NULL, - `custom_surcharge_tax1` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax2` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax3` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax4` tinyint(1) NOT NULL DEFAULT '0', - `exchange_rate` decimal(20,6) NOT NULL DEFAULT '1.000000', + `custom_surcharge_tax1` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax2` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax3` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax4` tinyint(1) NOT NULL DEFAULT 0, + `exchange_rate` decimal(20,6) NOT NULL DEFAULT 1.000000, `amount` decimal(20,6) NOT NULL, `balance` decimal(20,6) NOT NULL, `partial` decimal(20,6) DEFAULT NULL, @@ -1024,10 +1131,10 @@ CREATE TABLE `invoices` ( `reminder2_sent` date DEFAULT NULL, `reminder3_sent` date DEFAULT NULL, `reminder_last_sent` date DEFAULT NULL, - `auto_bill_enabled` tinyint(1) NOT NULL DEFAULT '0', - `paid_to_date` decimal(20,6) NOT NULL DEFAULT '0.000000', - `subscription_id` int unsigned DEFAULT NULL, - `auto_bill_tries` smallint NOT NULL DEFAULT '0', + `auto_bill_enabled` tinyint(1) NOT NULL DEFAULT 0, + `paid_to_date` decimal(20,6) NOT NULL DEFAULT 0.000000, + `subscription_id` int(10) unsigned DEFAULT NULL, + `auto_bill_tries` smallint(6) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), UNIQUE KEY `invoices_company_id_number_unique` (`company_id`,`number`), KEY `invoices_user_id_foreign` (`user_id`), @@ -1043,79 +1150,79 @@ CREATE TABLE `invoices` ( /*!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 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `jobs` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT, - `queue` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `payload` longtext CHARACTER SET utf8mb4 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, + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `queue` varchar(191) NOT NULL, + `payload` longtext NOT NULL, + `attempts` tinyint(3) unsigned NOT NULL, + `reserved_at` int(10) unsigned DEFAULT NULL, + `available_at` int(10) unsigned NOT NULL, + `created_at` int(10) unsigned NOT NULL, PRIMARY KEY (`id`), KEY `jobs_queue_index` (`queue`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `languages`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `languages` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `locale` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(191) NOT NULL, + `locale` varchar(191) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `licenses`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `licenses` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, - `first_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `last_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `license_key` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `first_name` varchar(191) DEFAULT NULL, + `last_name` varchar(191) DEFAULT NULL, + `email` varchar(191) DEFAULT NULL, + `license_key` varchar(191) DEFAULT NULL, `is_claimed` tinyint(1) DEFAULT NULL, - `transaction_reference` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `product_id` int unsigned DEFAULT NULL, - `recurring_invoice_id` bigint unsigned DEFAULT NULL, + `transaction_reference` varchar(191) DEFAULT NULL, + `product_id` int(10) unsigned DEFAULT NULL, + `recurring_invoice_id` bigint(20) unsigned DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `licenses_license_key_unique` (`license_key`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!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 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `migrations` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `migration` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `batch` int NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `migration` varchar(191) NOT NULL, + `batch` int(11) 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 `password_resets`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `password_resets` ( - `email` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `email` varchar(128) NOT NULL, + `token` varchar(255) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, KEY `password_resets_email_index` (`email`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `payment_hashes`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `payment_hashes` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `hash` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `hash` varchar(255) NOT NULL, `fee_total` decimal(16,4) NOT NULL, - `fee_invoice_id` int unsigned DEFAULT NULL, - `data` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `payment_id` int unsigned DEFAULT NULL, + `fee_invoice_id` int(10) unsigned DEFAULT NULL, + `data` mediumtext NOT NULL, + `payment_id` int(10) unsigned DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, PRIMARY KEY (`id`), @@ -1126,26 +1233,26 @@ CREATE TABLE `payment_hashes` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `payment_libraries`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `payment_libraries` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `visible` tinyint(1) NOT NULL DEFAULT '1', + `name` varchar(191) DEFAULT NULL, + `visible` tinyint(1) NOT NULL DEFAULT 1, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `payment_terms`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `payment_terms` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `num_days` int DEFAULT NULL, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `company_id` int unsigned DEFAULT NULL, - `user_id` int unsigned DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `num_days` int(11) DEFAULT NULL, + `name` varchar(191) DEFAULT NULL, + `company_id` int(10) unsigned DEFAULT NULL, + `user_id` int(10) unsigned DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, @@ -1158,24 +1265,24 @@ CREATE TABLE `payment_terms` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `payment_types`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `payment_types` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `gateway_type_id` int DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(191) NOT NULL, + `gateway_type_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `paymentables`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `paymentables` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `payment_id` int unsigned NOT NULL, - `paymentable_id` int unsigned NOT NULL, - `amount` decimal(16,4) NOT NULL DEFAULT '0.0000', - `refunded` decimal(16,4) NOT NULL DEFAULT '0.0000', - `paymentable_type` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `payment_id` int(10) unsigned NOT NULL, + `paymentable_id` int(10) unsigned NOT NULL, + `amount` decimal(16,4) NOT NULL DEFAULT 0.0000, + `refunded` decimal(16,4) NOT NULL DEFAULT 0.0000, + `paymentable_type` varchar(191) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, @@ -1187,43 +1294,44 @@ CREATE TABLE `paymentables` ( /*!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 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `payments` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `client_id` int unsigned NOT NULL, - `project_id` int unsigned DEFAULT NULL, - `vendor_id` int unsigned DEFAULT NULL, - `user_id` int unsigned DEFAULT NULL, - `assigned_user_id` int unsigned DEFAULT NULL, - `client_contact_id` int unsigned DEFAULT NULL, - `invitation_id` int unsigned DEFAULT NULL, - `company_gateway_id` int unsigned DEFAULT NULL, - `gateway_type_id` int unsigned DEFAULT NULL, - `type_id` int unsigned DEFAULT NULL, - `status_id` int unsigned NOT NULL, - `amount` decimal(20,6) NOT NULL DEFAULT '0.000000', - `refunded` decimal(20,6) NOT NULL DEFAULT '0.000000', - `applied` decimal(20,6) NOT NULL DEFAULT '0.000000', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `client_id` int(10) unsigned NOT NULL, + `project_id` int(10) unsigned DEFAULT NULL, + `vendor_id` int(10) unsigned DEFAULT NULL, + `user_id` int(10) unsigned DEFAULT NULL, + `assigned_user_id` int(10) unsigned DEFAULT NULL, + `client_contact_id` int(10) unsigned DEFAULT NULL, + `invitation_id` int(10) unsigned DEFAULT NULL, + `company_gateway_id` int(10) unsigned DEFAULT NULL, + `gateway_type_id` int(10) unsigned DEFAULT NULL, + `type_id` int(10) unsigned DEFAULT NULL, + `status_id` int(10) unsigned NOT NULL, + `amount` decimal(20,6) NOT NULL DEFAULT 0.000000, + `refunded` decimal(20,6) NOT NULL DEFAULT 0.000000, + `applied` decimal(20,6) NOT NULL DEFAULT 0.000000, `date` date DEFAULT NULL, - `transaction_reference` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `payer_id` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `private_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `transaction_reference` varchar(191) DEFAULT NULL, + `payer_id` varchar(191) DEFAULT NULL, + `number` varchar(191) DEFAULT NULL, + `private_notes` text DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `is_manual` tinyint(1) NOT NULL DEFAULT '0', - `exchange_rate` decimal(20,6) NOT NULL DEFAULT '1.000000', - `currency_id` int unsigned NOT NULL, - `exchange_currency_id` int unsigned DEFAULT NULL, - `meta` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `idempotency_key` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `is_manual` tinyint(1) NOT NULL DEFAULT 0, + `exchange_rate` decimal(20,6) NOT NULL DEFAULT 1.000000, + `currency_id` int(10) unsigned NOT NULL, + `exchange_currency_id` int(10) unsigned DEFAULT NULL, + `meta` text DEFAULT NULL, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, + `idempotency_key` varchar(64) DEFAULT NULL, + `transaction_id` bigint(20) unsigned DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `payments_company_id_idempotency_key_unique` (`company_id`,`idempotency_key`), KEY `payments_company_id_deleted_at_index` (`company_id`,`deleted_at`), @@ -1244,36 +1352,36 @@ CREATE TABLE `payments` ( /*!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 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `products` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `assigned_user_id` int unsigned DEFAULT NULL, - `project_id` int unsigned DEFAULT NULL, - `vendor_id` int unsigned DEFAULT NULL, - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `product_key` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `cost` decimal(20,6) NOT NULL DEFAULT '0.000000', - `price` decimal(20,6) NOT NULL DEFAULT '0.000000', - `quantity` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name1` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate1` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name2` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate2` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name3` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate3` decimal(20,6) NOT NULL DEFAULT '0.000000', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `assigned_user_id` int(10) unsigned DEFAULT NULL, + `project_id` int(10) unsigned DEFAULT NULL, + `vendor_id` int(10) unsigned DEFAULT NULL, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, + `product_key` varchar(191) DEFAULT NULL, + `notes` text DEFAULT NULL, + `cost` decimal(20,6) NOT NULL DEFAULT 0.000000, + `price` decimal(20,6) NOT NULL DEFAULT 0.000000, + `quantity` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name1` varchar(191) DEFAULT NULL, + `tax_rate1` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name2` varchar(191) DEFAULT NULL, + `tax_rate2` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name3` varchar(191) DEFAULT NULL, + `tax_rate3` decimal(20,6) NOT NULL DEFAULT 0.000000, `deleted_at` timestamp(6) NULL DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `in_stock_quantity` int NOT NULL DEFAULT '0', - `stock_notification` tinyint(1) NOT NULL DEFAULT '1', - `stock_notification_threshold` int NOT NULL DEFAULT '0', + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `in_stock_quantity` int(11) NOT NULL DEFAULT 0, + `stock_notification` tinyint(1) NOT NULL DEFAULT 1, + `stock_notification_threshold` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `products_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `products_user_id_foreign` (`user_id`), @@ -1286,29 +1394,29 @@ CREATE TABLE `products` ( /*!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 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `projects` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `user_id` int unsigned NOT NULL, - `assigned_user_id` int unsigned DEFAULT NULL, - `company_id` int unsigned NOT NULL, - `client_id` int unsigned DEFAULT NULL, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `task_rate` decimal(20,6) NOT NULL DEFAULT '0.000000', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `user_id` int(10) unsigned NOT NULL, + `assigned_user_id` int(10) unsigned DEFAULT NULL, + `company_id` int(10) unsigned NOT NULL, + `client_id` int(10) unsigned DEFAULT NULL, + `name` varchar(191) NOT NULL, + `task_rate` decimal(20,6) NOT NULL DEFAULT 0.000000, `due_date` date DEFAULT NULL, - `private_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `private_notes` text DEFAULT NULL, `budgeted_hours` decimal(20,6) NOT NULL, - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, - `public_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `color` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#fff', + `public_notes` text DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `number` varchar(191) DEFAULT NULL, + `color` varchar(191) NOT NULL DEFAULT '#fff', PRIMARY KEY (`id`), KEY `projects_user_id_foreign` (`user_id`), KEY `projects_company_id_deleted_at_index` (`company_id`,`deleted_at`), @@ -1319,18 +1427,18 @@ CREATE TABLE `projects` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `purchase_order_invitations`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `purchase_order_invitations` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `vendor_contact_id` int unsigned NOT NULL, - `purchase_order_id` bigint unsigned NOT NULL, - `key` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `transaction_reference` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `message_id` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email_error` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `signature_base64` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `vendor_contact_id` int(10) unsigned NOT NULL, + `purchase_order_id` bigint(20) unsigned NOT NULL, + `key` varchar(191) NOT NULL, + `transaction_reference` varchar(191) DEFAULT NULL, + `message_id` varchar(191) DEFAULT NULL, + `email_error` mediumtext DEFAULT NULL, + `signature_base64` text DEFAULT NULL, `signature_date` datetime DEFAULT NULL, `sent_date` datetime DEFAULT NULL, `viewed_date` datetime DEFAULT NULL, @@ -1338,7 +1446,7 @@ CREATE TABLE `purchase_order_invitations` ( `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `email_status` enum('delivered','bounced','spam') COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `email_status` enum('delivered','bounced','spam') DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `vendor_purchase_unique` (`vendor_contact_id`,`purchase_order_id`), KEY `purchase_order_invitations_user_id_foreign` (`user_id`), @@ -1355,69 +1463,69 @@ CREATE TABLE `purchase_order_invitations` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `purchase_orders`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `purchase_orders` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT, - `client_id` int unsigned DEFAULT NULL, - `user_id` int unsigned NOT NULL, - `assigned_user_id` int unsigned DEFAULT NULL, - `company_id` int unsigned NOT NULL, - `status_id` int unsigned NOT NULL, - `project_id` int unsigned DEFAULT NULL, - `vendor_id` int unsigned DEFAULT NULL, - `recurring_id` int unsigned DEFAULT NULL, - `design_id` int unsigned DEFAULT NULL, - `invoice_id` int unsigned DEFAULT NULL, - `number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `discount` double(8,2) NOT NULL DEFAULT '0.00', - `is_amount_discount` tinyint(1) NOT NULL DEFAULT '0', - `po_number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `client_id` int(10) unsigned DEFAULT NULL, + `user_id` int(10) unsigned NOT NULL, + `assigned_user_id` int(10) unsigned DEFAULT NULL, + `company_id` int(10) unsigned NOT NULL, + `status_id` int(10) unsigned NOT NULL, + `project_id` int(10) unsigned DEFAULT NULL, + `vendor_id` int(10) unsigned DEFAULT NULL, + `recurring_id` int(10) unsigned DEFAULT NULL, + `design_id` int(10) unsigned DEFAULT NULL, + `invoice_id` int(10) unsigned DEFAULT NULL, + `number` varchar(191) DEFAULT NULL, + `discount` double(8,2) NOT NULL DEFAULT 0.00, + `is_amount_discount` tinyint(1) NOT NULL DEFAULT 0, + `po_number` varchar(191) DEFAULT NULL, `date` date DEFAULT NULL, `last_sent_date` datetime DEFAULT NULL, `due_date` date DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `line_items` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `backup` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `footer` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `public_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `private_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `terms` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `tax_name1` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate1` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name2` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate2` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name3` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate3` decimal(20,6) NOT NULL DEFAULT '0.000000', - `total_taxes` decimal(20,6) NOT NULL DEFAULT '0.000000', - `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT '0', + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `line_items` mediumtext DEFAULT NULL, + `backup` mediumtext DEFAULT NULL, + `footer` text DEFAULT NULL, + `public_notes` text DEFAULT NULL, + `private_notes` text DEFAULT NULL, + `terms` text DEFAULT NULL, + `tax_name1` varchar(191) DEFAULT NULL, + `tax_rate1` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name2` varchar(191) DEFAULT NULL, + `tax_rate2` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name3` varchar(191) DEFAULT NULL, + `tax_rate3` decimal(20,6) NOT NULL DEFAULT 0.000000, + `total_taxes` decimal(20,6) NOT NULL DEFAULT 0.000000, + `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT 0, `reminder1_sent` date DEFAULT NULL, `reminder2_sent` date DEFAULT NULL, `reminder3_sent` date DEFAULT NULL, `reminder_last_sent` date DEFAULT NULL, - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, `next_send_date` datetime DEFAULT NULL, `custom_surcharge1` decimal(20,6) DEFAULT NULL, `custom_surcharge2` decimal(20,6) DEFAULT NULL, `custom_surcharge3` decimal(20,6) DEFAULT NULL, `custom_surcharge4` decimal(20,6) DEFAULT NULL, - `custom_surcharge_tax1` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax2` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax3` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax4` tinyint(1) NOT NULL DEFAULT '0', - `exchange_rate` decimal(20,6) NOT NULL DEFAULT '1.000000', + `custom_surcharge_tax1` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax2` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax3` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax4` tinyint(1) NOT NULL DEFAULT 0, + `exchange_rate` decimal(20,6) NOT NULL DEFAULT 1.000000, `balance` decimal(20,6) NOT NULL, `partial` decimal(20,6) DEFAULT NULL, `amount` decimal(20,6) NOT NULL, - `paid_to_date` decimal(20,6) NOT NULL DEFAULT '0.000000', + `paid_to_date` decimal(20,6) NOT NULL DEFAULT 0.000000, `partial_due_date` datetime DEFAULT NULL, `last_viewed` datetime DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, - `expense_id` int unsigned DEFAULT NULL, + `expense_id` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), KEY `purchase_orders_user_id_foreign` (`user_id`), KEY `purchase_orders_company_id_deleted_at_index` (`company_id`,`deleted_at`), @@ -1431,18 +1539,18 @@ CREATE TABLE `purchase_orders` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `quote_invitations`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `quote_invitations` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `client_contact_id` int unsigned NOT NULL, - `quote_id` int unsigned NOT NULL, - `key` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `transaction_reference` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `message_id` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email_error` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `signature_base64` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `client_contact_id` int(10) unsigned NOT NULL, + `quote_id` int(10) unsigned NOT NULL, + `key` varchar(191) NOT NULL, + `transaction_reference` varchar(191) DEFAULT NULL, + `message_id` varchar(191) DEFAULT NULL, + `email_error` mediumtext DEFAULT NULL, + `signature_base64` text DEFAULT NULL, `signature_date` datetime DEFAULT NULL, `sent_date` datetime DEFAULT NULL, `viewed_date` datetime DEFAULT NULL, @@ -1450,8 +1558,8 @@ CREATE TABLE `quote_invitations` ( `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `signature_ip` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `email_status` enum('delivered','bounced','spam') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `signature_ip` text DEFAULT NULL, + `email_status` enum('delivered','bounced','spam') DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `quote_invitations_client_contact_id_quote_id_unique` (`client_contact_id`,`quote_id`), KEY `quote_invitations_user_id_foreign` (`user_id`), @@ -1467,55 +1575,55 @@ CREATE TABLE `quote_invitations` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `quotes`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `quotes` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `client_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `assigned_user_id` int unsigned DEFAULT NULL, - `company_id` int unsigned NOT NULL, - `status_id` int unsigned NOT NULL, - `project_id` int unsigned DEFAULT NULL, - `vendor_id` int unsigned DEFAULT NULL, - `recurring_id` int unsigned DEFAULT NULL, - `design_id` int unsigned DEFAULT NULL, - `invoice_id` int unsigned DEFAULT NULL, - `number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `discount` double(8,2) NOT NULL DEFAULT '0.00', - `is_amount_discount` tinyint(1) NOT NULL DEFAULT '0', - `po_number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `client_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `assigned_user_id` int(10) unsigned DEFAULT NULL, + `company_id` int(10) unsigned NOT NULL, + `status_id` int(10) unsigned NOT NULL, + `project_id` int(10) unsigned DEFAULT NULL, + `vendor_id` int(10) unsigned DEFAULT NULL, + `recurring_id` int(10) unsigned DEFAULT NULL, + `design_id` int(10) unsigned DEFAULT NULL, + `invoice_id` int(10) unsigned DEFAULT NULL, + `number` varchar(191) DEFAULT NULL, + `discount` double(8,2) NOT NULL DEFAULT 0.00, + `is_amount_discount` tinyint(1) NOT NULL DEFAULT 0, + `po_number` varchar(191) DEFAULT NULL, `date` date DEFAULT NULL, `last_sent_date` date DEFAULT NULL, `due_date` datetime DEFAULT NULL, `next_send_date` datetime DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `line_items` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `backup` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `footer` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `public_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `private_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `terms` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `tax_name1` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate1` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name2` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate2` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name3` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate3` decimal(20,6) NOT NULL DEFAULT '0.000000', - `total_taxes` decimal(20,6) NOT NULL DEFAULT '0.000000', - `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT '0', - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `line_items` mediumtext DEFAULT NULL, + `backup` mediumtext DEFAULT NULL, + `footer` text DEFAULT NULL, + `public_notes` text DEFAULT NULL, + `private_notes` text DEFAULT NULL, + `terms` text DEFAULT NULL, + `tax_name1` varchar(191) DEFAULT NULL, + `tax_rate1` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name2` varchar(191) DEFAULT NULL, + `tax_rate2` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name3` varchar(191) DEFAULT NULL, + `tax_rate3` decimal(20,6) NOT NULL DEFAULT 0.000000, + `total_taxes` decimal(20,6) NOT NULL DEFAULT 0.000000, + `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT 0, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, `custom_surcharge1` decimal(20,6) DEFAULT NULL, `custom_surcharge2` decimal(20,6) DEFAULT NULL, `custom_surcharge3` decimal(20,6) DEFAULT NULL, `custom_surcharge4` decimal(20,6) DEFAULT NULL, - `custom_surcharge_tax1` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax2` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax3` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax4` tinyint(1) NOT NULL DEFAULT '0', - `exchange_rate` decimal(20,6) NOT NULL DEFAULT '1.000000', + `custom_surcharge_tax1` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax2` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax3` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax4` tinyint(1) NOT NULL DEFAULT 0, + `exchange_rate` decimal(20,6) NOT NULL DEFAULT 1.000000, `amount` decimal(20,6) NOT NULL, `balance` decimal(20,6) NOT NULL, `partial` decimal(20,6) DEFAULT NULL, @@ -1528,8 +1636,8 @@ CREATE TABLE `quotes` ( `reminder2_sent` date DEFAULT NULL, `reminder3_sent` date DEFAULT NULL, `reminder_last_sent` date DEFAULT NULL, - `paid_to_date` decimal(20,6) NOT NULL DEFAULT '0.000000', - `subscription_id` int unsigned DEFAULT NULL, + `paid_to_date` decimal(20,6) NOT NULL DEFAULT 0.000000, + `subscription_id` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `quotes_company_id_number_unique` (`company_id`,`number`), KEY `quotes_user_id_foreign` (`user_id`), @@ -1544,38 +1652,38 @@ CREATE TABLE `quotes` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `recurring_expenses`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `recurring_expenses` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, - `company_id` int unsigned NOT NULL, - `vendor_id` int unsigned DEFAULT NULL, - `user_id` int unsigned NOT NULL, - `status_id` int unsigned NOT NULL, - `invoice_id` int unsigned DEFAULT NULL, - `client_id` int unsigned DEFAULT NULL, - `bank_id` int unsigned DEFAULT NULL, - `project_id` int unsigned DEFAULT NULL, - `payment_type_id` int unsigned DEFAULT NULL, - `recurring_expense_id` int unsigned DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT '1', - `tax_name1` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_name2` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_name3` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `company_id` int(10) unsigned NOT NULL, + `vendor_id` int(10) unsigned DEFAULT NULL, + `user_id` int(10) unsigned NOT NULL, + `status_id` int(10) unsigned NOT NULL, + `invoice_id` int(10) unsigned DEFAULT NULL, + `client_id` int(10) unsigned DEFAULT NULL, + `bank_id` int(10) unsigned DEFAULT NULL, + `project_id` int(10) unsigned DEFAULT NULL, + `payment_type_id` int(10) unsigned DEFAULT NULL, + `recurring_expense_id` int(10) unsigned DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT 1, + `tax_name1` varchar(191) DEFAULT NULL, + `tax_name2` varchar(191) DEFAULT NULL, + `tax_name3` varchar(191) DEFAULT NULL, `date` date DEFAULT NULL, `payment_date` date DEFAULT NULL, - `should_be_invoiced` tinyint(1) NOT NULL DEFAULT '0', - `invoice_documents` tinyint(1) NOT NULL DEFAULT '0', - `transaction_id` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `category_id` int unsigned DEFAULT NULL, - `calculate_tax_by_amount` tinyint(1) NOT NULL DEFAULT '0', + `should_be_invoiced` tinyint(1) NOT NULL DEFAULT 0, + `invoice_documents` tinyint(1) NOT NULL DEFAULT 0, + `transaction_id` varchar(191) DEFAULT NULL, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, + `category_id` int(10) unsigned DEFAULT NULL, + `calculate_tax_by_amount` tinyint(1) NOT NULL DEFAULT 0, `tax_amount1` decimal(20,6) DEFAULT NULL, `tax_amount2` decimal(20,6) DEFAULT NULL, `tax_amount3` decimal(20,6) DEFAULT NULL, @@ -1584,18 +1692,18 @@ CREATE TABLE `recurring_expenses` ( `tax_rate3` decimal(20,6) DEFAULT NULL, `amount` decimal(20,6) DEFAULT NULL, `foreign_amount` decimal(20,6) DEFAULT NULL, - `exchange_rate` decimal(20,6) NOT NULL DEFAULT '1.000000', - `assigned_user_id` int unsigned DEFAULT NULL, - `number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `invoice_currency_id` int unsigned DEFAULT NULL, - `currency_id` int unsigned DEFAULT NULL, - `private_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `public_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `transaction_reference` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `frequency_id` int unsigned NOT NULL, + `exchange_rate` decimal(20,6) NOT NULL DEFAULT 1.000000, + `assigned_user_id` int(10) unsigned DEFAULT NULL, + `number` varchar(191) DEFAULT NULL, + `invoice_currency_id` int(10) unsigned DEFAULT NULL, + `currency_id` int(10) unsigned DEFAULT NULL, + `private_notes` text DEFAULT NULL, + `public_notes` text DEFAULT NULL, + `transaction_reference` text DEFAULT NULL, + `frequency_id` int(10) unsigned NOT NULL, `last_sent_date` datetime DEFAULT NULL, `next_send_date` datetime DEFAULT NULL, - `remaining_cycles` int DEFAULT NULL, + `remaining_cycles` int(11) DEFAULT NULL, `next_send_date_client` datetime DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `recurring_expenses_company_id_number_unique` (`company_id`,`number`), @@ -1608,26 +1716,26 @@ CREATE TABLE `recurring_expenses` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `recurring_invoice_invitations`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `recurring_invoice_invitations` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `client_contact_id` int unsigned NOT NULL, - `recurring_invoice_id` int unsigned NOT NULL, - `key` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `client_contact_id` int(10) unsigned NOT NULL, + `recurring_invoice_id` int(10) unsigned NOT NULL, + `key` varchar(191) NOT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `transaction_reference` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `message_id` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email_error` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `signature_base64` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `transaction_reference` varchar(191) DEFAULT NULL, + `message_id` varchar(191) DEFAULT NULL, + `email_error` mediumtext DEFAULT NULL, + `signature_base64` text DEFAULT NULL, `signature_date` datetime DEFAULT NULL, `sent_date` datetime DEFAULT NULL, `viewed_date` datetime DEFAULT NULL, `opened_date` datetime DEFAULT NULL, - `email_status` enum('delivered','bounced','spam') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `email_status` enum('delivered','bounced','spam') DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `cli_rec` (`client_contact_id`,`recurring_invoice_id`), KEY `recurring_invoice_invitations_user_id_foreign` (`user_id`), @@ -1643,68 +1751,68 @@ CREATE TABLE `recurring_invoice_invitations` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `recurring_invoices`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `recurring_invoices` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `client_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `assigned_user_id` int unsigned DEFAULT NULL, - `company_id` int unsigned NOT NULL, - `project_id` int unsigned DEFAULT NULL, - `vendor_id` int unsigned DEFAULT NULL, - `status_id` int unsigned NOT NULL, - `number` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `discount` double(8,2) NOT NULL DEFAULT '0.00', - `is_amount_discount` tinyint(1) NOT NULL DEFAULT '0', - `po_number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `client_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `assigned_user_id` int(10) unsigned DEFAULT NULL, + `company_id` int(10) unsigned NOT NULL, + `project_id` int(10) unsigned DEFAULT NULL, + `vendor_id` int(10) unsigned DEFAULT NULL, + `status_id` int(10) unsigned NOT NULL, + `number` text DEFAULT NULL, + `discount` double(8,2) NOT NULL DEFAULT 0.00, + `is_amount_discount` tinyint(1) NOT NULL DEFAULT 0, + `po_number` varchar(191) DEFAULT NULL, `date` date DEFAULT NULL, `due_date` datetime DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `line_items` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `backup` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `footer` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `public_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `private_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `terms` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `tax_name1` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate1` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name2` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate2` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name3` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate3` decimal(20,6) NOT NULL DEFAULT '0.000000', - `total_taxes` decimal(20,6) NOT NULL DEFAULT '0.000000', - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `line_items` mediumtext DEFAULT NULL, + `backup` mediumtext DEFAULT NULL, + `footer` text DEFAULT NULL, + `public_notes` text DEFAULT NULL, + `private_notes` text DEFAULT NULL, + `terms` text DEFAULT NULL, + `tax_name1` varchar(191) DEFAULT NULL, + `tax_rate1` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name2` varchar(191) DEFAULT NULL, + `tax_rate2` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name3` varchar(191) DEFAULT NULL, + `tax_rate3` decimal(20,6) NOT NULL DEFAULT 0.000000, + `total_taxes` decimal(20,6) NOT NULL DEFAULT 0.000000, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, `amount` decimal(20,6) NOT NULL, `balance` decimal(20,6) NOT NULL, `partial` decimal(16,4) DEFAULT NULL, `last_viewed` datetime DEFAULT NULL, - `frequency_id` int unsigned NOT NULL, + `frequency_id` int(10) unsigned NOT NULL, `last_sent_date` datetime DEFAULT NULL, `next_send_date` datetime DEFAULT NULL, - `remaining_cycles` int DEFAULT NULL, + `remaining_cycles` int(11) DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `auto_bill` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'off', - `auto_bill_enabled` tinyint(1) NOT NULL DEFAULT '0', - `design_id` int unsigned DEFAULT NULL, - `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT '0', + `auto_bill` varchar(191) NOT NULL DEFAULT 'off', + `auto_bill_enabled` tinyint(1) NOT NULL DEFAULT 0, + `design_id` int(10) unsigned DEFAULT NULL, + `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT 0, `custom_surcharge1` decimal(20,6) DEFAULT NULL, `custom_surcharge2` decimal(20,6) DEFAULT NULL, `custom_surcharge3` decimal(20,6) DEFAULT NULL, `custom_surcharge4` decimal(20,6) DEFAULT NULL, - `custom_surcharge_tax1` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax2` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax3` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax4` tinyint(1) NOT NULL DEFAULT '0', - `due_date_days` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `custom_surcharge_tax1` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax2` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax3` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax4` tinyint(1) NOT NULL DEFAULT 0, + `due_date_days` varchar(191) DEFAULT NULL, `partial_due_date` date DEFAULT NULL, - `exchange_rate` decimal(13,6) NOT NULL DEFAULT '1.000000', - `paid_to_date` decimal(20,6) NOT NULL DEFAULT '0.000000', - `subscription_id` int unsigned DEFAULT NULL, + `exchange_rate` decimal(13,6) NOT NULL DEFAULT 1.000000, + `paid_to_date` decimal(20,6) NOT NULL DEFAULT 0.000000, + `subscription_id` int(10) unsigned DEFAULT NULL, `next_send_date_client` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `recurring_invoices_company_id_deleted_at_index` (`company_id`,`deleted_at`), @@ -1719,23 +1827,23 @@ CREATE TABLE `recurring_invoices` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `recurring_quote_invitations`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `recurring_quote_invitations` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `client_contact_id` int unsigned NOT NULL, - `recurring_quote_id` int unsigned NOT NULL, - `key` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `transaction_reference` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `message_id` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email_error` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `signature_base64` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `client_contact_id` int(10) unsigned NOT NULL, + `recurring_quote_id` int(10) unsigned NOT NULL, + `key` varchar(191) NOT NULL, + `transaction_reference` varchar(191) DEFAULT NULL, + `message_id` varchar(191) DEFAULT NULL, + `email_error` mediumtext DEFAULT NULL, + `signature_base64` text DEFAULT NULL, `signature_date` datetime DEFAULT NULL, `sent_date` datetime DEFAULT NULL, `viewed_date` datetime DEFAULT NULL, `opened_date` datetime DEFAULT NULL, - `email_status` enum('delivered','bounced','spam') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `email_status` enum('delivered','bounced','spam') DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, @@ -1754,67 +1862,67 @@ CREATE TABLE `recurring_quote_invitations` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `recurring_quotes`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `recurring_quotes` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `client_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `assigned_user_id` int unsigned DEFAULT NULL, - `company_id` int unsigned NOT NULL, - `project_id` int unsigned DEFAULT NULL, - `vendor_id` int unsigned DEFAULT NULL, - `status_id` int unsigned NOT NULL, - `discount` double(8,2) NOT NULL DEFAULT '0.00', - `is_amount_discount` tinyint(1) NOT NULL DEFAULT '0', - `number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `po_number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `client_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `assigned_user_id` int(10) unsigned DEFAULT NULL, + `company_id` int(10) unsigned NOT NULL, + `project_id` int(10) unsigned DEFAULT NULL, + `vendor_id` int(10) unsigned DEFAULT NULL, + `status_id` int(10) unsigned NOT NULL, + `discount` double(8,2) NOT NULL DEFAULT 0.00, + `is_amount_discount` tinyint(1) NOT NULL DEFAULT 0, + `number` varchar(191) DEFAULT NULL, + `po_number` varchar(191) DEFAULT NULL, `date` date DEFAULT NULL, `due_date` datetime DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `line_items` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `backup` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `footer` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `public_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `private_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `terms` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `tax_name1` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate1` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name2` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate2` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name3` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate3` decimal(20,6) NOT NULL DEFAULT '0.000000', - `total_taxes` decimal(20,6) NOT NULL DEFAULT '0.000000', - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `amount` decimal(20,6) NOT NULL DEFAULT '0.000000', - `balance` decimal(20,6) NOT NULL DEFAULT '0.000000', + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `line_items` mediumtext DEFAULT NULL, + `backup` mediumtext DEFAULT NULL, + `footer` text DEFAULT NULL, + `public_notes` text DEFAULT NULL, + `private_notes` text DEFAULT NULL, + `terms` text DEFAULT NULL, + `tax_name1` varchar(191) DEFAULT NULL, + `tax_rate1` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name2` varchar(191) DEFAULT NULL, + `tax_rate2` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name3` varchar(191) DEFAULT NULL, + `tax_rate3` decimal(20,6) NOT NULL DEFAULT 0.000000, + `total_taxes` decimal(20,6) NOT NULL DEFAULT 0.000000, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, + `amount` decimal(20,6) NOT NULL DEFAULT 0.000000, + `balance` decimal(20,6) NOT NULL DEFAULT 0.000000, `last_viewed` datetime DEFAULT NULL, - `frequency_id` int unsigned NOT NULL, + `frequency_id` int(10) unsigned NOT NULL, `last_sent_date` datetime DEFAULT NULL, `next_send_date` datetime DEFAULT NULL, - `remaining_cycles` int unsigned DEFAULT NULL, + `remaining_cycles` int(10) unsigned DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `auto_bill` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'off', - `auto_bill_enabled` tinyint(1) NOT NULL DEFAULT '0', - `paid_to_date` decimal(20,6) NOT NULL DEFAULT '0.000000', + `auto_bill` varchar(191) NOT NULL DEFAULT 'off', + `auto_bill_enabled` tinyint(1) NOT NULL DEFAULT 0, + `paid_to_date` decimal(20,6) NOT NULL DEFAULT 0.000000, `custom_surcharge1` decimal(20,6) DEFAULT NULL, `custom_surcharge2` decimal(20,6) DEFAULT NULL, `custom_surcharge3` decimal(20,6) DEFAULT NULL, `custom_surcharge4` decimal(20,6) DEFAULT NULL, - `custom_surcharge_tax1` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax2` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax3` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax4` tinyint(1) NOT NULL DEFAULT '0', - `due_date_days` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `exchange_rate` decimal(13,6) NOT NULL DEFAULT '1.000000', + `custom_surcharge_tax1` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax2` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax3` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax4` tinyint(1) NOT NULL DEFAULT 0, + `due_date_days` varchar(191) DEFAULT NULL, + `exchange_rate` decimal(13,6) NOT NULL DEFAULT 1.000000, `partial` decimal(16,4) DEFAULT NULL, `partial_due_date` date DEFAULT NULL, - `subscription_id` int unsigned DEFAULT NULL, - `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT '1', + `subscription_id` int(10) unsigned DEFAULT NULL, + `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT 1, PRIMARY KEY (`id`), KEY `recurring_quotes_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `recurring_quotes_user_id_foreign` (`user_id`), @@ -1828,69 +1936,73 @@ CREATE TABLE `recurring_quotes` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `schedulers`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `schedulers` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT, - `paused` tinyint(1) NOT NULL DEFAULT '0', - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `repeat_every` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `start_from` timestamp NOT NULL, - `scheduled_run` timestamp NOT NULL, - `company_id` bigint unsigned NOT NULL, + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `paused` tinyint(1) NOT NULL DEFAULT 0, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `repeat_every` varchar(191) NOT NULL, + `start_from` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `scheduled_run` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `company_id` bigint(20) unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, - `action_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `action_class` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `parameters` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `action_name` varchar(191) NOT NULL, + `action_class` varchar(191) NOT NULL, + `parameters` mediumtext DEFAULT NULL, PRIMARY KEY (`id`), KEY `schedulers_action_name_index` (`action_name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `sizes`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `sizes` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(191) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `subscriptions`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `subscriptions` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `user_id` int unsigned NOT NULL, - `assigned_user_id` int unsigned DEFAULT NULL, - `company_id` int unsigned NOT NULL, - `product_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `frequency_id` int unsigned DEFAULT NULL, - `auto_bill` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `promo_code` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `promo_discount` double(8,2) NOT NULL DEFAULT '0.00', - `is_amount_discount` tinyint(1) NOT NULL DEFAULT '0', - `allow_cancellation` tinyint(1) NOT NULL DEFAULT '1', - `per_seat_enabled` tinyint(1) NOT NULL DEFAULT '0', - `min_seats_limit` int unsigned NOT NULL, - `max_seats_limit` int unsigned NOT NULL, - `trial_enabled` tinyint(1) NOT NULL DEFAULT '0', - `trial_duration` int unsigned NOT NULL, - `allow_query_overrides` tinyint(1) NOT NULL DEFAULT '0', - `allow_plan_changes` tinyint(1) NOT NULL DEFAULT '0', - `plan_map` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `refund_period` int unsigned DEFAULT NULL, - `webhook_configuration` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `user_id` int(10) unsigned NOT NULL, + `assigned_user_id` int(10) unsigned DEFAULT NULL, + `company_id` int(10) unsigned NOT NULL, + `product_ids` text DEFAULT NULL, + `frequency_id` int(10) unsigned DEFAULT NULL, + `auto_bill` text DEFAULT NULL, + `promo_code` text DEFAULT NULL, + `promo_discount` double(8,2) NOT NULL DEFAULT 0.00, + `is_amount_discount` tinyint(1) NOT NULL DEFAULT 0, + `allow_cancellation` tinyint(1) NOT NULL DEFAULT 1, + `per_seat_enabled` tinyint(1) NOT NULL DEFAULT 0, + `min_seats_limit` int(10) unsigned NOT NULL, + `max_seats_limit` int(10) unsigned NOT NULL, + `trial_enabled` tinyint(1) NOT NULL DEFAULT 0, + `trial_duration` int(10) unsigned NOT NULL, + `allow_query_overrides` tinyint(1) NOT NULL DEFAULT 0, + `allow_plan_changes` tinyint(1) NOT NULL DEFAULT 0, + `plan_map` text DEFAULT NULL, + `refund_period` int(10) unsigned DEFAULT NULL, + `webhook_configuration` mediumtext NOT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, - `currency_id` int unsigned DEFAULT NULL, - `recurring_product_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `group_id` int unsigned DEFAULT NULL, - `price` decimal(20,6) NOT NULL DEFAULT '0.000000', - `promo_price` decimal(20,6) NOT NULL DEFAULT '0.000000', + `currency_id` int(10) unsigned DEFAULT NULL, + `recurring_product_ids` text DEFAULT NULL, + `name` varchar(191) NOT NULL, + `group_id` int(10) unsigned DEFAULT NULL, + `price` decimal(20,6) NOT NULL DEFAULT 0.000000, + `promo_price` decimal(20,6) NOT NULL DEFAULT 0.000000, + `registration_required` tinyint(1) NOT NULL DEFAULT 0, + `use_inventory_management` tinyint(1) NOT NULL DEFAULT 0, + `optional_product_ids` text DEFAULT NULL, + `optional_recurring_product_ids` text DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `subscriptions_company_id_name_unique` (`company_id`,`name`), KEY `billing_subscriptions_company_id_deleted_at_index` (`company_id`,`deleted_at`), @@ -1899,16 +2011,16 @@ CREATE TABLE `subscriptions` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `system_logs`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `system_logs` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `user_id` int unsigned DEFAULT NULL, - `client_id` int unsigned DEFAULT NULL, - `category_id` int unsigned DEFAULT NULL, - `event_id` int unsigned DEFAULT NULL, - `type_id` int unsigned DEFAULT NULL, - `log` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned DEFAULT NULL, + `client_id` int(10) unsigned DEFAULT NULL, + `category_id` int(10) unsigned DEFAULT NULL, + `event_id` int(10) unsigned DEFAULT NULL, + `type_id` int(10) unsigned DEFAULT NULL, + `log` mediumtext NOT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, @@ -1921,19 +2033,19 @@ CREATE TABLE `system_logs` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `task_statuses`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `task_statuses` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `company_id` int unsigned DEFAULT NULL, - `user_id` int unsigned DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(191) DEFAULT NULL, + `company_id` int(10) unsigned DEFAULT NULL, + `user_id` int(10) unsigned DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `status_sort_order` int DEFAULT NULL, - `color` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#fff', - `status_order` int DEFAULT NULL, + `status_sort_order` int(11) DEFAULT NULL, + `color` varchar(191) NOT NULL DEFAULT '#fff', + `status_order` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `task_statuses_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `task_statuses_user_id_foreign` (`user_id`), @@ -1943,34 +2055,35 @@ CREATE TABLE `task_statuses` ( /*!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 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `tasks` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `user_id` int unsigned NOT NULL, - `assigned_user_id` int unsigned DEFAULT NULL, - `company_id` int unsigned NOT NULL, - `client_id` int unsigned DEFAULT NULL, - `invoice_id` int unsigned DEFAULT NULL, - `project_id` int unsigned DEFAULT NULL, - `status_id` int unsigned DEFAULT NULL, - `status_sort_order` int DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `user_id` int(10) unsigned NOT NULL, + `assigned_user_id` int(10) unsigned DEFAULT NULL, + `company_id` int(10) unsigned NOT NULL, + `client_id` int(10) unsigned DEFAULT NULL, + `invoice_id` int(10) unsigned DEFAULT NULL, + `project_id` int(10) unsigned DEFAULT NULL, + `status_id` int(10) unsigned DEFAULT NULL, + `status_sort_order` int(11) DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `duration` int unsigned DEFAULT NULL, - `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `is_running` tinyint(1) NOT NULL DEFAULT '0', - `time_log` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `rate` decimal(20,6) NOT NULL DEFAULT '0.000000', - `invoice_documents` tinyint(1) NOT NULL DEFAULT '0', - `is_date_based` tinyint(1) NOT NULL DEFAULT '0', - `status_order` int DEFAULT NULL, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, + `duration` int(10) unsigned DEFAULT NULL, + `description` text DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `is_running` tinyint(1) NOT NULL DEFAULT 0, + `time_log` text DEFAULT NULL, + `number` varchar(191) DEFAULT NULL, + `rate` decimal(20,6) NOT NULL DEFAULT 0.000000, + `invoice_documents` tinyint(1) NOT NULL DEFAULT 0, + `is_date_based` tinyint(1) NOT NULL DEFAULT 0, + `status_order` int(11) DEFAULT NULL, + `invoice_lock` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `tasks_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `tasks_user_id_foreign` (`user_id`), @@ -1985,17 +2098,17 @@ CREATE TABLE `tasks` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `tax_rates`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `tax_rates` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `user_id` int unsigned DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `rate` decimal(20,6) NOT NULL DEFAULT '0.000000', - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `name` varchar(100) NOT NULL, + `rate` decimal(20,6) NOT NULL DEFAULT 0.000000, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `tax_rates_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `tax_rates_user_id_foreign` (`user_id`), @@ -2006,44 +2119,44 @@ CREATE TABLE `tax_rates` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `timezones`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `timezones` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `location` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `utc_offset` int NOT NULL DEFAULT '0', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(191) NOT NULL, + `location` varchar(191) NOT NULL, + `utc_offset` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `transaction_events`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `transaction_events` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `client_id` int unsigned NOT NULL, - `invoice_id` int unsigned NOT NULL, - `payment_id` int unsigned NOT NULL, - `credit_id` int unsigned NOT NULL, - `client_balance` decimal(16,4) NOT NULL DEFAULT '0.0000', - `client_paid_to_date` decimal(16,4) NOT NULL DEFAULT '0.0000', - `client_credit_balance` decimal(16,4) NOT NULL DEFAULT '0.0000', - `invoice_balance` decimal(16,4) NOT NULL DEFAULT '0.0000', - `invoice_amount` decimal(16,4) NOT NULL DEFAULT '0.0000', - `invoice_partial` decimal(16,4) NOT NULL DEFAULT '0.0000', - `invoice_paid_to_date` decimal(16,4) NOT NULL DEFAULT '0.0000', - `invoice_status` int unsigned DEFAULT NULL, - `payment_amount` decimal(16,4) NOT NULL DEFAULT '0.0000', - `payment_applied` decimal(16,4) NOT NULL DEFAULT '0.0000', - `payment_refunded` decimal(16,4) NOT NULL DEFAULT '0.0000', - `payment_status` int unsigned DEFAULT NULL, - `paymentables` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `event_id` int unsigned NOT NULL, - `timestamp` int unsigned NOT NULL, - `payment_request` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `metadata` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `credit_balance` decimal(16,4) NOT NULL DEFAULT '0.0000', - `credit_amount` decimal(16,4) NOT NULL DEFAULT '0.0000', - `credit_status` int unsigned DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `client_id` int(10) unsigned NOT NULL, + `invoice_id` int(10) unsigned NOT NULL, + `payment_id` int(10) unsigned NOT NULL, + `credit_id` int(10) unsigned NOT NULL, + `client_balance` decimal(16,4) NOT NULL DEFAULT 0.0000, + `client_paid_to_date` decimal(16,4) NOT NULL DEFAULT 0.0000, + `client_credit_balance` decimal(16,4) NOT NULL DEFAULT 0.0000, + `invoice_balance` decimal(16,4) NOT NULL DEFAULT 0.0000, + `invoice_amount` decimal(16,4) NOT NULL DEFAULT 0.0000, + `invoice_partial` decimal(16,4) NOT NULL DEFAULT 0.0000, + `invoice_paid_to_date` decimal(16,4) NOT NULL DEFAULT 0.0000, + `invoice_status` int(10) unsigned DEFAULT NULL, + `payment_amount` decimal(16,4) NOT NULL DEFAULT 0.0000, + `payment_applied` decimal(16,4) NOT NULL DEFAULT 0.0000, + `payment_refunded` decimal(16,4) NOT NULL DEFAULT 0.0000, + `payment_status` int(10) unsigned DEFAULT NULL, + `paymentables` mediumtext DEFAULT NULL, + `event_id` int(10) unsigned NOT NULL, + `timestamp` int(10) unsigned NOT NULL, + `payment_request` mediumtext DEFAULT NULL, + `metadata` mediumtext DEFAULT NULL, + `credit_balance` decimal(16,4) NOT NULL DEFAULT 0.0000, + `credit_amount` decimal(16,4) NOT NULL DEFAULT 0.0000, + `credit_status` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), KEY `transaction_events_client_id_index` (`client_id`), CONSTRAINT `transaction_events_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE @@ -2051,46 +2164,48 @@ CREATE TABLE `transaction_events` ( /*!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 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `users` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `account_id` int unsigned NOT NULL, - `first_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `last_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `phone` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `ip` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `device_token` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `account_id` int(10) unsigned NOT NULL, + `first_name` varchar(191) DEFAULT NULL, + `last_name` varchar(191) DEFAULT NULL, + `phone` varchar(191) DEFAULT NULL, + `ip` varchar(191) DEFAULT NULL, + `device_token` varchar(191) DEFAULT NULL, + `email` varchar(100) NOT NULL, `email_verified_at` timestamp NULL DEFAULT NULL, - `confirmation_code` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `theme_id` int DEFAULT NULL, - `failed_logins` smallint DEFAULT NULL, - `referral_code` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `oauth_user_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `oauth_user_token` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `oauth_provider_id` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `google_2fa_secret` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `accepted_terms_version` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `avatar` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `avatar_width` int unsigned DEFAULT NULL, - `avatar_height` int unsigned DEFAULT NULL, - `avatar_size` int unsigned DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `confirmation_code` varchar(191) DEFAULT NULL, + `theme_id` int(11) DEFAULT NULL, + `failed_logins` smallint(6) DEFAULT NULL, + `referral_code` varchar(191) DEFAULT NULL, + `oauth_user_id` varchar(100) DEFAULT NULL, + `oauth_user_token` text DEFAULT NULL, + `oauth_provider_id` varchar(191) DEFAULT NULL, + `google_2fa_secret` text DEFAULT NULL, + `accepted_terms_version` varchar(191) DEFAULT NULL, + `avatar` varchar(100) DEFAULT NULL, + `avatar_width` int(10) unsigned DEFAULT NULL, + `avatar_height` int(10) unsigned DEFAULT NULL, + `avatar_size` int(10) unsigned DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, `last_login` datetime DEFAULT NULL, - `signature` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `password` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `remember_token` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `signature` mediumtext DEFAULT NULL, + `password` varchar(191) NOT NULL, + `remember_token` varchar(100) DEFAULT NULL, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `oauth_user_refresh_token` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `last_confirmed_email_address` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `has_password` tinyint(1) NOT NULL DEFAULT '0', + `oauth_user_refresh_token` text DEFAULT NULL, + `last_confirmed_email_address` varchar(191) DEFAULT NULL, + `has_password` tinyint(1) NOT NULL DEFAULT 0, `oauth_user_token_expiry` datetime DEFAULT NULL, + `sms_verification_code` varchar(191) DEFAULT NULL, + `verified_phone_number` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), UNIQUE KEY `users_email_unique` (`email`), UNIQUE KEY `users_oauth_user_id_oauth_provider_id_unique` (`oauth_user_id`,`oauth_provider_id`), @@ -2100,42 +2215,42 @@ CREATE TABLE `users` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `vendor_contacts`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `vendor_contacts` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `vendor_id` int unsigned NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `vendor_id` int(10) unsigned NOT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, - `is_primary` tinyint(1) NOT NULL DEFAULT '0', - `first_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `last_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `phone` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `send_email` tinyint(1) NOT NULL DEFAULT '0', + `is_primary` tinyint(1) NOT NULL DEFAULT 0, + `first_name` varchar(191) DEFAULT NULL, + `last_name` varchar(191) DEFAULT NULL, + `email` varchar(191) DEFAULT NULL, + `phone` varchar(191) DEFAULT NULL, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, + `send_email` tinyint(1) NOT NULL DEFAULT 0, `email_verified_at` timestamp NULL DEFAULT NULL, - `confirmation_code` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `confirmed` tinyint(1) NOT NULL DEFAULT '0', + `confirmation_code` varchar(191) DEFAULT NULL, + `confirmed` tinyint(1) NOT NULL DEFAULT 0, `last_login` timestamp NULL DEFAULT NULL, - `failed_logins` smallint DEFAULT NULL, - `oauth_user_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `oauth_provider_id` int unsigned DEFAULT NULL, - `google_2fa_secret` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `accepted_terms_version` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `avatar_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `avatar_size` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `password` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `token` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `is_locked` tinyint(1) NOT NULL DEFAULT '0', - `contact_key` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `remember_token` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `failed_logins` smallint(6) DEFAULT NULL, + `oauth_user_id` varchar(100) DEFAULT NULL, + `oauth_provider_id` int(10) unsigned DEFAULT NULL, + `google_2fa_secret` varchar(191) DEFAULT NULL, + `accepted_terms_version` varchar(191) DEFAULT NULL, + `avatar` varchar(255) DEFAULT NULL, + `avatar_type` varchar(255) DEFAULT NULL, + `avatar_size` varchar(255) DEFAULT NULL, + `password` varchar(191) NOT NULL, + `token` varchar(191) DEFAULT NULL, + `is_locked` tinyint(1) NOT NULL DEFAULT 0, + `contact_key` varchar(191) DEFAULT NULL, + `remember_token` varchar(100) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `vendor_contacts_oauth_user_id_unique` (`oauth_user_id`), UNIQUE KEY `vendor_contacts_oauth_provider_id_unique` (`oauth_provider_id`), @@ -2152,37 +2267,37 @@ CREATE TABLE `vendor_contacts` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `vendors`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `vendors` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, - `user_id` int unsigned NOT NULL, - `assigned_user_id` int unsigned DEFAULT NULL, - `company_id` int unsigned NOT NULL, - `currency_id` int unsigned DEFAULT NULL, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `address1` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `address2` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `city` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `state` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `postal_code` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `country_id` int unsigned DEFAULT NULL, - `phone` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `private_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `website` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `is_deleted` tinyint NOT NULL DEFAULT '0', - `vat_number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `transaction_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `vendor_hash` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `public_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `id_number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` int(10) unsigned NOT NULL, + `assigned_user_id` int(10) unsigned DEFAULT NULL, + `company_id` int(10) unsigned NOT NULL, + `currency_id` int(10) unsigned DEFAULT NULL, + `name` varchar(191) DEFAULT NULL, + `address1` varchar(191) DEFAULT NULL, + `address2` varchar(191) DEFAULT NULL, + `city` varchar(191) DEFAULT NULL, + `state` varchar(191) DEFAULT NULL, + `postal_code` varchar(191) DEFAULT NULL, + `country_id` int(10) unsigned DEFAULT NULL, + `phone` varchar(191) DEFAULT NULL, + `private_notes` text DEFAULT NULL, + `website` varchar(191) DEFAULT NULL, + `is_deleted` tinyint(4) NOT NULL DEFAULT 0, + `vat_number` varchar(191) DEFAULT NULL, + `transaction_name` varchar(191) DEFAULT NULL, + `number` varchar(191) DEFAULT NULL, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, + `vendor_hash` text DEFAULT NULL, + `public_notes` text DEFAULT NULL, + `id_number` varchar(191) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `vendors_company_id_number_unique` (`company_id`,`number`), KEY `vendors_company_id_deleted_at_index` (`company_id`,`deleted_at`), @@ -2197,20 +2312,20 @@ CREATE TABLE `vendors` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `webhooks`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `webhooks` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned DEFAULT NULL, - `user_id` int unsigned DEFAULT NULL, - `event_id` int unsigned DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `target_url` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `format` enum('JSON','UBL') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'JSON', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned DEFAULT NULL, + `user_id` int(10) unsigned DEFAULT NULL, + `event_id` int(10) unsigned DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `target_url` varchar(191) NOT NULL, + `format` enum('JSON','UBL') NOT NULL DEFAULT 'JSON', `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `rest_method` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `headers` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `rest_method` text DEFAULT NULL, + `headers` text DEFAULT NULL, PRIMARY KEY (`id`), KEY `subscriptions_company_id_foreign` (`company_id`), KEY `subscriptions_event_id_company_id_index` (`event_id`,`company_id`), @@ -2391,3 +2506,13 @@ INSERT INTO `migrations` VALUES (164,'2022_09_21_012417_add_threeds_to_braintree INSERT INTO `migrations` VALUES (165,'2022_09_30_235337_add_idempotency_key_to_payments',12); INSERT INTO `migrations` VALUES (166,'2022_10_05_205645_add_indexes_to_client_hash',12); INSERT INTO `migrations` VALUES (167,'2022_10_06_011344_add_key_to_products',12); +INSERT INTO `migrations` VALUES (168,'2022_08_05_023357_bank_integration',13); +INSERT INTO `migrations` VALUES (169,'2022_10_07_065455_add_key_to_company_tokens_table',13); +INSERT INTO `migrations` VALUES (170,'2022_10_10_070137_add_documentable_index',13); +INSERT INTO `migrations` VALUES (171,'2022_10_27_044909_add_user_sms_verification_code',13); +INSERT INTO `migrations` VALUES (172,'2022_11_02_063742_add_verified_number_flag_to_users_table',13); +INSERT INTO `migrations` VALUES (173,'2022_11_04_013539_disabled_upstream_bank_integrations_table',13); +INSERT INTO `migrations` VALUES (174,'2022_11_06_215526_drop_html_backups_column_from_backups_table',13); +INSERT INTO `migrations` VALUES (175,'2022_11_13_034143_bank_transaction_rules_table',13); +INSERT INTO `migrations` VALUES (176,'2022_11_16_093535_calmness_design',13); +INSERT INTO `migrations` VALUES (177,'2022_11_22_215618_lock_tasks_when_invoiced',13);