From 290775040ea3a23f15770e4cbfda7de5bfbbf36c Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 26 Apr 2022 07:42:41 +1000 Subject: [PATCH 1/9] Fix length of auth.net fields --- app/PaymentDrivers/Authorize/AuthorizePaymentMethod.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/PaymentDrivers/Authorize/AuthorizePaymentMethod.php b/app/PaymentDrivers/Authorize/AuthorizePaymentMethod.php index 4efad4605283..c9b810323fd1 100644 --- a/app/PaymentDrivers/Authorize/AuthorizePaymentMethod.php +++ b/app/PaymentDrivers/Authorize/AuthorizePaymentMethod.php @@ -176,7 +176,7 @@ class AuthorizePaymentMethod $billto->setCountry($this->authorize->client->country->name); } - $billto->setPhoneNumber($this->authorize->client->phone); + $billto->setPhoneNumber(substr($this->authorize->client->phone,0,20)); } // Create a new Customer Payment Profile object From bc76424fd7951d78425c575f988d4d084fa8ef6b Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 26 Apr 2022 08:51:14 +1000 Subject: [PATCH 2/9] FIxes for approve with no conversion from AP --- app/Http/Requests/Client/UpdateClientRequest.php | 6 +++++- app/Services/Quote/TriggeredActions.php | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Http/Requests/Client/UpdateClientRequest.php b/app/Http/Requests/Client/UpdateClientRequest.php index ccc6af785c47..0d4661321278 100644 --- a/app/Http/Requests/Client/UpdateClientRequest.php +++ b/app/Http/Requests/Client/UpdateClientRequest.php @@ -158,7 +158,11 @@ class UpdateClientRequest extends Request unset($settings->{$key}); } - if($key == 'default_task_rate'){ + //26-04-2022 - In case settings are returned as array instead of object + if($key == 'default_task_rate' && is_array($settings)){ + $settings['default_task_rate'] = floatval($value); + } + elseif($key == 'default_task_rate' && is_object($settings)) { $settings->default_task_rate = floatval($value); } } diff --git a/app/Services/Quote/TriggeredActions.php b/app/Services/Quote/TriggeredActions.php index 3ee104670288..4b9fbe5fbff7 100644 --- a/app/Services/Quote/TriggeredActions.php +++ b/app/Services/Quote/TriggeredActions.php @@ -51,7 +51,7 @@ class TriggeredActions extends AbstractService } if ($this->request->has('approve') && $this->request->input('approve') == 'true' && in_array($this->quote->status_id, [Quote::STATUS_SENT, Quote::STATUS_DRAFT])) { - $this->quote = $this->quote->service()->convert()->save(); + $this->quote = $this->quote->service()->approveWithNoCoversion()->save(); } From 3a6258fd42a3130bb7b603c8fb052abbeddd735f Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 26 Apr 2022 11:46:33 +1000 Subject: [PATCH 3/9] Release transactions on failures --- app/Import/Providers/BaseImport.php | 4 ++++ app/PaymentDrivers/StripePaymentDriver.php | 2 +- app/Services/Invoice/MarkPaid.php | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Import/Providers/BaseImport.php b/app/Import/Providers/BaseImport.php index 5d9a8447c2d0..6552c51a8490 100644 --- a/app/Import/Providers/BaseImport.php +++ b/app/Import/Providers/BaseImport.php @@ -309,6 +309,10 @@ class BaseImport ); } } catch (\Exception $ex) { + + if(\DB::connection(config('database.default'))->transactionLevel() > 0) + \DB::connection(config('database.default'))->rollBack(); + if ($ex instanceof ImportException) { $message = $ex->getMessage(); } else { diff --git a/app/PaymentDrivers/StripePaymentDriver.php b/app/PaymentDrivers/StripePaymentDriver.php index cc4a769be12a..30975d119ad9 100644 --- a/app/PaymentDrivers/StripePaymentDriver.php +++ b/app/PaymentDrivers/StripePaymentDriver.php @@ -445,7 +445,7 @@ class StripePaymentDriver extends BaseDriver if(count($searchResults) == 1){ $customer = $searchResults->data[0]; - $this->updateStripeCustomer($customer); + // $this->updateStripeCustomer($customer); return $customer; } diff --git a/app/Services/Invoice/MarkPaid.php b/app/Services/Invoice/MarkPaid.php index 17cfdf5e1437..36a93cc7bae3 100644 --- a/app/Services/Invoice/MarkPaid.php +++ b/app/Services/Invoice/MarkPaid.php @@ -105,7 +105,7 @@ class MarkPaid extends AbstractService /* Get the last record for the client and set the current balance*/ $client = Client::where('id', $this->invoice->client_id)->lockForUpdate()->first(); $client->paid_to_date += $payment->amount; - $client->balance += $payment->amount * -1; + $client->balance -= $payment->amount; $client->save(); }, 1); From 649defb2bd846ec7777c05ba9af894a64cb92130 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 26 Apr 2022 12:51:32 +1000 Subject: [PATCH 4/9] fixes for localizing company deleted email --- app/Mail/Company/CompanyDeleted.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Mail/Company/CompanyDeleted.php b/app/Mail/Company/CompanyDeleted.php index 99e197d97b03..ba8b4494632f 100644 --- a/app/Mail/Company/CompanyDeleted.php +++ b/app/Mail/Company/CompanyDeleted.php @@ -50,7 +50,10 @@ class CompanyDeleted extends Mailable public function build() { App::forgetInstance('translator'); - App::setLocale($this->account->default_company->getLocale()); + + if($this->company) + App::setLocale($this->company->getLocale()); + $t = app('translator'); $t->replace(Ninja::transformTranslations($this->settings)); From cb840fc06b8aa62022c53984a2377d8aa9f9a7b3 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 26 Apr 2022 13:21:59 +1000 Subject: [PATCH 5/9] Ensure all recurring invoices have a valid state - post migration --- app/Jobs/Util/Import.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Jobs/Util/Import.php b/app/Jobs/Util/Import.php index aa5ebffa04ac..d394e870bd05 100644 --- a/app/Jobs/Util/Import.php +++ b/app/Jobs/Util/Import.php @@ -948,6 +948,11 @@ class Import implements ShouldQueue RecurringInvoiceFactory::create($this->company->id, $modified['user_id']) ); + if($invoice->status_id == 4 && $invoice->remaining_cycles == -1){ + $invoice->status_id =2; + $invoice->save(); + } + $key = "recurring_invoices_{$resource['id']}"; $this->ids['recurring_invoices'][$key] = [ From f4bfc69a492d2595f2b98fa9d13b4630427078cc Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 26 Apr 2022 13:39:35 +1000 Subject: [PATCH 6/9] change columns from varchar to text --- ...tom_fields_column_from_varchar_to_text.php | 191 ++++++++++++++++++ 1 file changed, 191 insertions(+) create mode 100644 database/migrations/2022_04_26_032252_convert_custom_fields_column_from_varchar_to_text.php diff --git a/database/migrations/2022_04_26_032252_convert_custom_fields_column_from_varchar_to_text.php b/database/migrations/2022_04_26_032252_convert_custom_fields_column_from_varchar_to_text.php new file mode 100644 index 000000000000..520730dca190 --- /dev/null +++ b/database/migrations/2022_04_26_032252_convert_custom_fields_column_from_varchar_to_text.php @@ -0,0 +1,191 @@ +text('custom_value1')->change(); + $table->text('custom_value2')->change(); + $table->text('custom_value3')->change(); + $table->text('custom_value3')->change(); + + }); + + Schema::table('client_contacts', function (Blueprint $table) { + + $table->text('custom_value1')->change(); + $table->text('custom_value2')->change(); + $table->text('custom_value3')->change(); + $table->text('custom_value3')->change(); + + }); + + Schema::table('clients', function (Blueprint $table) { + + $table->text('custom_value1')->change(); + $table->text('custom_value2')->change(); + $table->text('custom_value3')->change(); + $table->text('custom_value3')->change(); + + }); + + Schema::table('clients', function (Blueprint $table) { + + $table->text('custom_value1')->change(); + $table->text('custom_value2')->change(); + $table->text('custom_value3')->change(); + $table->text('custom_value3')->change(); + + }); + + Schema::table('documents', function (Blueprint $table) { + + $table->text('custom_value1')->change(); + $table->text('custom_value2')->change(); + $table->text('custom_value3')->change(); + $table->text('custom_value3')->change(); + + }); + + Schema::table('expenses', function (Blueprint $table) { + + $table->text('custom_value1')->change(); + $table->text('custom_value2')->change(); + $table->text('custom_value3')->change(); + $table->text('custom_value3')->change(); + + }); + + Schema::table('invoices', function (Blueprint $table) { + + $table->text('custom_value1')->change(); + $table->text('custom_value2')->change(); + $table->text('custom_value3')->change(); + $table->text('custom_value3')->change(); + + }); + + Schema::table('payments', function (Blueprint $table) { + + $table->text('custom_value1')->change(); + $table->text('custom_value2')->change(); + $table->text('custom_value3')->change(); + $table->text('custom_value3')->change(); + + }); + + Schema::table('products', function (Blueprint $table) { + + $table->text('custom_value1')->change(); + $table->text('custom_value2')->change(); + $table->text('custom_value3')->change(); + $table->text('custom_value3')->change(); + + }); + + Schema::table('projects', function (Blueprint $table) { + + $table->text('custom_value1')->change(); + $table->text('custom_value2')->change(); + $table->text('custom_value3')->change(); + $table->text('custom_value3')->change(); + + }); + + Schema::table('quotes', function (Blueprint $table) { + + $table->text('custom_value1')->change(); + $table->text('custom_value2')->change(); + $table->text('custom_value3')->change(); + $table->text('custom_value3')->change(); + + }); + + Schema::table('recurring_invoices', function (Blueprint $table) { + + $table->text('custom_value1')->change(); + $table->text('custom_value2')->change(); + $table->text('custom_value3')->change(); + $table->text('custom_value3')->change(); + + }); + + Schema::table('recurring_quotes', function (Blueprint $table) { + + $table->text('custom_value1')->change(); + $table->text('custom_value2')->change(); + $table->text('custom_value3')->change(); + $table->text('custom_value3')->change(); + + }); + + Schema::table('recurring_expenses', function (Blueprint $table) { + + $table->text('custom_value1')->change(); + $table->text('custom_value2')->change(); + $table->text('custom_value3')->change(); + $table->text('custom_value3')->change(); + + }); + + Schema::table('tasks', function (Blueprint $table) { + + $table->text('custom_value1')->change(); + $table->text('custom_value2')->change(); + $table->text('custom_value3')->change(); + $table->text('custom_value3')->change(); + + }); + + Schema::table('users', function (Blueprint $table) { + + $table->text('custom_value1')->change(); + $table->text('custom_value2')->change(); + $table->text('custom_value3')->change(); + $table->text('custom_value3')->change(); + + }); + + Schema::table('vendors', function (Blueprint $table) { + + $table->text('custom_value1')->change(); + $table->text('custom_value2')->change(); + $table->text('custom_value3')->change(); + $table->text('custom_value3')->change(); + + }); + + Schema::table('vendor_contacts', function (Blueprint $table) { + + $table->text('custom_value1')->change(); + $table->text('custom_value2')->change(); + $table->text('custom_value3')->change(); + $table->text('custom_value3')->change(); + + }); + + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + + } +} From ea39f4eefc81077e052769d9bf2a40ac4940256c Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 26 Apr 2022 14:00:42 +1000 Subject: [PATCH 7/9] Add file system checks to self checker --- app/Jobs/Util/Import.php | 1 - app/Utils/SystemHealth.php | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/app/Jobs/Util/Import.php b/app/Jobs/Util/Import.php index d394e870bd05..9f8ede9be12e 100644 --- a/app/Jobs/Util/Import.php +++ b/app/Jobs/Util/Import.php @@ -241,7 +241,6 @@ class Import implements ShouldQueue $this->company->account->companies()->update(['is_large' => true]); } - $this->company->client_registration_fields = \App\DataMapper\ClientRegistrationFields::generate(); $this->company->save(); diff --git a/app/Utils/SystemHealth.php b/app/Utils/SystemHealth.php index 3cb6dd16121e..b5b64f20a5a3 100644 --- a/app/Utils/SystemHealth.php +++ b/app/Utils/SystemHealth.php @@ -81,9 +81,31 @@ class SystemHealth 'pdf_engine' => (string) self::getPdfEngine(), 'queue' => (string) config('queue.default'), 'trailing_slash' => (bool) self::checkUrlState(), + 'file_permissions' => (string) self::checkFileSystem() ]; } + public static function checkFileSystem() + { + + $directoryIterator = new \RecursiveDirectoryIterator(base_path(), \RecursiveDirectoryIterator::SKIP_DOTS); + + foreach (new \RecursiveIteratorIterator($directoryIterator) as $file) { + + if(strpos($file->getPathname(), '.git') !== false) + continue; + + //nlog($file->getPathname()); + + if ($file->isFile() && ! $file->isWritable()) { + return "{$file->getFileName()} is not writable"; + } + } + + return 'Ok'; + + } + public static function checkUrlState() { if (env('APP_URL') && substr(env('APP_URL'), -1) == '/') From e52171860558e5caab74bd297e2547e484b8ddb7 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 26 Apr 2022 16:53:41 +1000 Subject: [PATCH 8/9] New Schema Dump --- app/Import/Providers/BaseImport.php | 61 + app/Import/Providers/Csv.php | 2 +- app/Import/Transformer/BaseTransformer.php | 10 +- app/Models/Company.php | 1 - app/Utils/HtmlEngine.php | 4 +- app/Utils/Traits/MakesInvoiceValues.php | 28 +- database/schema/db-ninja-01-schema.dump | 1732 ++++++++++---------- tests/Feature/Import/Zoho/ZohoTest.php | 7 +- 8 files changed, 978 insertions(+), 867 deletions(-) diff --git a/app/Import/Providers/BaseImport.php b/app/Import/Providers/BaseImport.php index 6552c51a8490..4f11b0fbb503 100644 --- a/app/Import/Providers/BaseImport.php +++ b/app/Import/Providers/BaseImport.php @@ -181,6 +181,65 @@ class BaseImport } catch (\Exception $ex) { + if(\DB::connection(config('database.default'))->transactionLevel() > 0) + \DB::connection(config('database.default'))->rollBack(); + + if ($ex instanceof ImportException) { + $message = $ex->getMessage(); + } else { + report($ex); + $message = 'Unknown error'; + } + + $this->error_array[$entity_type][] = [ + $entity_type => $record, + 'error' => $message, + ]; + } + + } + + return $count; + } + + public function ingestProducts($data, $entity_type) + { + $count = 0; + + foreach ($data as $key => $record) { + + try { + + $entity = $this->transformer->transform($record); + $validator = $this->request_name::runFormRequest($entity); + + if ($validator->fails()) { + $this->error_array[$entity_type][] = [ + $entity_type => $record, + 'error' => $validator->errors()->all(), + ]; + } else { + + if($this->transformer->hasProduct($entity['product_key'])) + $product = $this->transformer->getProduct($entity['product_key']); + else + $product = $this->factory_name::create($this->company->id,$this->getUserIDForRecord($entity)); + + $entity = $this->repository->save( + array_diff_key($entity, ['user_id' => false]), + $product + ); + + $entity->saveQuietly(); + $count++; + + } + + } catch (\Exception $ex) { + + if(\DB::connection(config('database.default'))->transactionLevel() > 0) + \DB::connection(config('database.default'))->rollBack(); + if ($ex instanceof ImportException) { $message = $ex->getMessage(); } else { @@ -510,6 +569,8 @@ class BaseImport 'company' => $this->company, ]; +nlog($this->company->company_users); + $nmo = new NinjaMailerObject; $nmo->mailable = new ImportCompleted($this->company, $data); $nmo->company = $this->company; diff --git a/app/Import/Providers/Csv.php b/app/Import/Providers/Csv.php index 68a366488624..364821fe1ef8 100644 --- a/app/Import/Providers/Csv.php +++ b/app/Import/Providers/Csv.php @@ -116,7 +116,7 @@ class Csv extends BaseImport implements ImportInterface $this->transformer = new ProductTransformer($this->company); - $product_count = $this->ingest($data, $entity_type); + $product_count = $this->ingestProducts($data, $entity_type); $this->entity_count['products'] = $product_count; } diff --git a/app/Import/Transformer/BaseTransformer.php b/app/Import/Transformer/BaseTransformer.php index fc4840fb0f35..c63ce61cbe28 100644 --- a/app/Import/Transformer/BaseTransformer.php +++ b/app/Import/Transformer/BaseTransformer.php @@ -199,20 +199,16 @@ class BaseTransformer * * @return string */ - public function getProduct($data, $key, $field, $default = false) + public function getProduct($key) { $product = $this->company ->products() ->whereRaw("LOWER(REPLACE(`product_key`, ' ' ,'')) = ?", [ - strtolower(str_replace(' ', '', $data->{$key})), + strtolower(str_replace(' ', '', $key)), ]) ->first(); - if ($product) { - return $product->{$field} ?: $default; - } - - return $default; + return $product; } /** diff --git a/app/Models/Company.php b/app/Models/Company.php index 35739589ae56..c1e911bf00ba 100644 --- a/app/Models/Company.php +++ b/app/Models/Company.php @@ -479,7 +479,6 @@ class Company extends BaseModel public function owner() { return $this->company_users()->withTrashed()->where('is_owner', true)->first()->user; - //return $this->company_users->where('is_owner', true)->first()->user; } public function resolveRouteBinding($value, $field = null) diff --git a/app/Utils/HtmlEngine.php b/app/Utils/HtmlEngine.php index 6f1a17a54ee3..50d332aa0b46 100644 --- a/app/Utils/HtmlEngine.php +++ b/app/Utils/HtmlEngine.php @@ -213,9 +213,9 @@ class HtmlEngine $data['$gross_subtotal'] = ['value' => Number::formatMoney($this->entity_calc->getGrossSubTotal(), $this->client) ?: ' ', 'label' => ctrans('texts.subtotal')]; if($this->entity->uses_inclusive_taxes) - $data['$net_subtotal'] = ['value' => Number::formatMoney(($this->entity_calc->getSubTotal() - $this->entity->total_taxes), $this->client) ?: ' ', 'label' => ctrans('texts.net_subtotal')]; + $data['$net_subtotal'] = ['value' => Number::formatMoney(($this->entity_calc->getSubTotal() - $this->entity->total_taxes - $this->entity_calc->getTotalDiscount()), $this->client) ?: ' ', 'label' => ctrans('texts.net_subtotal')]; else - $data['$net_subtotal'] = ['value' => Number::formatMoney($this->entity_calc->getSubTotal(), $this->client) ?: ' ', 'label' => ctrans('texts.net_subtotal')]; + $data['$net_subtotal'] = ['value' => Number::formatMoney($this->entity_calc->getSubTotal() - $this->entity_calc->getTotalDiscount(), $this->client) ?: ' ', 'label' => ctrans('texts.net_subtotal')]; $data['$invoice.subtotal'] = &$data['$subtotal']; diff --git a/app/Utils/Traits/MakesInvoiceValues.php b/app/Utils/Traits/MakesInvoiceValues.php index 6f0b4ea02971..5f43720daa2e 100644 --- a/app/Utils/Traits/MakesInvoiceValues.php +++ b/app/Utils/Traits/MakesInvoiceValues.php @@ -301,17 +301,29 @@ trait MakesInvoiceValues $data[$key][$table_type . ".{$_table_type}2"] = $helpers->formatCustomFieldValue($this->client->company->custom_fields, "{$_table_type}2", $item->custom_value2, $this->client); $data[$key][$table_type . ".{$_table_type}3"] = $helpers->formatCustomFieldValue($this->client->company->custom_fields, "{$_table_type}3", $item->custom_value3, $this->client); $data[$key][$table_type . ".{$_table_type}4"] = $helpers->formatCustomFieldValue($this->client->company->custom_fields, "{$_table_type}4", $item->custom_value4, $this->client); - - // 08-02-2022 - fix for regression below - // $data[$key][$table_type.'.quantity'] = Number::formatValue($item->quantity, $this->client->currency()); - $data[$key][$table_type.'.quantity'] = ($item->quantity == 0) ? '' : Number::formatValueNoTrailingZeroes($item->quantity, $this->client->currency()); - - $data[$key][$table_type.'.unit_cost'] = ($item->cost == 0) ? '' : Number::formatMoneyNoRounding($item->cost, $this->client); + if($item->quantity > 0 || $item->cost > 0){ - $data[$key][$table_type.'.cost'] = ($item->cost == 0) ? '' : Number::formatMoney($item->cost, $this->client); + $data[$key][$table_type.'.quantity'] = Number::formatValueNoTrailingZeroes($item->quantity, $this->client->currency()); + + $data[$key][$table_type.'.unit_cost'] = Number::formatMoneyNoRounding($item->cost, $this->client); - $data[$key][$table_type.'.line_total'] = ($item->line_total == 0) ? '' :Number::formatMoney($item->line_total, $this->client); + $data[$key][$table_type.'.cost'] = Number::formatMoney($item->cost, $this->client); + + $data[$key][$table_type.'.line_total'] = Number::formatMoney($item->line_total, $this->client); + + } + else { + + $data[$key][$table_type.'.quantity'] = ''; + + $data[$key][$table_type.'.unit_cost'] = ''; + + $data[$key][$table_type.'.cost'] = ''; + + $data[$key][$table_type.'.line_total'] = ''; + + } if(property_exists($item, 'gross_line_total')) $data[$key][$table_type.'.gross_line_total'] = ($item->gross_line_total == 0) ? '' :Number::formatMoney($item->gross_line_total, $this->client); diff --git a/database/schema/db-ninja-01-schema.dump b/database/schema/db-ninja-01-schema.dump index 2a9b312c852e..64acb93e94ce 100644 --- a/database/schema/db-ninja-01-schema.dump +++ b/database/schema/db-ninja-01-schema.dump @@ -6,75 +6,75 @@ /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `accounts`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `accounts` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `plan` enum('pro','enterprise','white_label') COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `plan_term` enum('month','year') COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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, `plan_started` date DEFAULT NULL, `plan_paid` date DEFAULT NULL, `plan_expires` date DEFAULT NULL, - `user_agent` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `payment_id` int(10) unsigned DEFAULT NULL, - `default_company_id` int(10) unsigned NOT 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, `trial_started` date DEFAULT NULL, - `trial_plan` enum('pro','enterprise') COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `trial_plan` enum('pro','enterprise') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, `plan_price` decimal(7,2) DEFAULT NULL, - `num_users` smallint(6) NOT NULL DEFAULT '1', - `utm_source` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `utm_medium` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `utm_campaign` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `utm_term` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `utm_content` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `latest_version` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0.0.0', + `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `referral_code` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci 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(10) unsigned DEFAULT NULL, + `trial_duration` int unsigned DEFAULT NULL, `is_onboarding` tinyint(1) NOT NULL DEFAULT '0', - `onboarding` mediumtext COLLATE utf8mb4_unicode_ci, + `onboarding` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, `is_migrated` tinyint(1) NOT NULL DEFAULT '0', - `platform` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `hosted_client_count` int(10) unsigned DEFAULT NULL, - `hosted_company_count` int(10) unsigned DEFAULT NULL, - `inapp_transaction_id` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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, PRIMARY KEY (`id`), KEY `accounts_payment_id_index` (`payment_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 `activities`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `activities` ( - `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) COLLATE utf8mb4_unicode_ci NOT NULL, + `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 COLLATE utf8mb4_unicode_ci NOT NULL, + `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL 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, + `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, 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`), @@ -93,16 +93,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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `backups` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `activity_id` int(10) unsigned NOT NULL, - `json_backup` mediumtext COLLATE utf8mb4_unicode_ci, - `html_backup` longtext COLLATE utf8mb4_unicode_ci, + `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, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `amount` decimal(16,4) NOT NULL, - `filename` text COLLATE utf8mb4_unicode_ci, + `filename` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, 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 @@ -110,13 +110,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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `bank_companies` ( - `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, @@ -131,15 +131,15 @@ CREATE TABLE `bank_companies` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `bank_subcompanies`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `bank_subcompanies` ( - `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `website` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `account_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, @@ -154,51 +154,51 @@ CREATE TABLE `bank_subcompanies` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `banks`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `banks` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `remote_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `bank_library_id` int(11) NOT NULL DEFAULT '1', - `config` text COLLATE utf8mb4_unicode_ci, + `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, 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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `client_contacts` ( - `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `last_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `phone` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value1` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, `email_verified_at` timestamp NULL DEFAULT NULL, - `confirmation_code` varchar(191) COLLATE utf8mb4_unicode_ci 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', `last_login` timestamp NULL DEFAULT NULL, - `failed_logins` smallint(6) DEFAULT NULL, - `oauth_user_id` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `oauth_provider_id` int(10) unsigned DEFAULT NULL, - `google_2fa_secret` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `accepted_terms_version` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `avatar` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `avatar_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `avatar_size` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `token` varchar(191) COLLATE utf8mb4_unicode_ci 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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, @@ -215,18 +215,18 @@ 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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `client_gateway_tokens` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `company_id` int(10) unsigned NOT NULL, - `client_id` int(10) unsigned DEFAULT NULL, - `token` text COLLATE utf8mb4_unicode_ci, - `routing_number` text COLLATE utf8mb4_unicode_ci, - `company_gateway_id` int(10) unsigned NOT NULL, - `gateway_customer_reference` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `gateway_type_id` int(10) unsigned NOT NULL, + `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 COLLATE utf8mb4_unicode_ci, + `meta` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, `deleted_at` timestamp(6) NULL DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, @@ -240,21 +240,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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `client_subscriptions` ( - `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, + `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', `deleted_at` timestamp(6) NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, - `invoice_id` int(10) unsigned DEFAULT NULL, - `quantity` int(10) unsigned NOT NULL DEFAULT '1', + `invoice_id` int unsigned DEFAULT NULL, + `quantity` int 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`), @@ -270,50 +270,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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `clients` ( - `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `website` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `private_notes` text COLLATE utf8mb4_unicode_ci, - `public_notes` text COLLATE utf8mb4_unicode_ci, - `client_hash` text COLLATE utf8mb4_unicode_ci, - `logo` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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', `last_login` timestamp NULL DEFAULT NULL, - `industry_id` int(10) unsigned DEFAULT NULL, - `size_id` int(10) unsigned DEFAULT NULL, - `address1` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `address2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `city` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `state` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `postal_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `country_id` int(10) unsigned DEFAULT NULL, - `custom_value1` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `shipping_address1` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `shipping_address2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `shipping_city` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `shipping_state` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `shipping_postal_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `shipping_country_id` int(10) unsigned DEFAULT NULL, - `settings` mediumtext COLLATE utf8mb4_unicode_ci, + `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` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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(10) unsigned DEFAULT NULL, - `vat_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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, `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `id_number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci 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`), @@ -328,13 +328,13 @@ CREATE TABLE `clients` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `companies`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `companies` ( - `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `company_key` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, + `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', @@ -345,29 +345,29 @@ CREATE TABLE `companies` ( `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', + `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `db` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `size_id` int(10) unsigned DEFAULT NULL, - `first_day_of_week` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `first_month_of_year` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `portal_mode` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'subdomain', - `portal_domain` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `enable_modules` smallint(6) NOT NULL DEFAULT '0', - `custom_fields` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL, - `settings` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL, - `slack_webhook_url` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `google_analytics_key` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, + `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, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, - `enabled_item_tax_rates` int(11) NOT NULL DEFAULT '0', + `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') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'off', + `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', @@ -380,16 +380,17 @@ CREATE TABLE `companies` ( `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(11) 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(11) NOT NULL DEFAULT '30', + `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 COLLATE utf8mb4_unicode_ci, + `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', PRIMARY KEY (`id`), UNIQUE KEY `companies_company_key_unique` (`company_key`), KEY `companies_industry_id_foreign` (`industry_id`), @@ -402,29 +403,29 @@ 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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `company_gateways` ( - `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) COLLATE utf8mb4_unicode_ci NOT NULL, - `accepted_credit_cards` int(10) unsigned NOT NULL, + `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 COLLATE utf8mb4_unicode_ci NOT NULL, - `fees_and_limits` text COLLATE utf8mb4_unicode_ci NOT NULL, - `custom_value1` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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, `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') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'off', - `label` varchar(255) COLLATE utf8mb4_unicode_ci 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', @@ -441,19 +442,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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `company_ledgers` ( - `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, + `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, `adjustment` decimal(20,6) DEFAULT NULL, `balance` decimal(20,6) DEFAULT NULL, - `notes` text COLLATE utf8mb4_unicode_ci, - `hash` text COLLATE utf8mb4_unicode_ci, - `company_ledgerable_id` int(10) unsigned NOT NULL, - `company_ledgerable_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT 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, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, PRIMARY KEY (`id`), @@ -465,14 +466,14 @@ 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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `company_tokens` ( - `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, @@ -490,16 +491,16 @@ 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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `company_user` ( - `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 COLLATE utf8mb4_unicode_ci, - `notifications` mediumtext COLLATE utf8mb4_unicode_ci, - `settings` mediumtext COLLATE utf8mb4_unicode_ci, - `slack_webhook_url` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, + `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', @@ -507,7 +508,7 @@ CREATE TABLE `company_user` ( `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 COLLATE utf8mb4_unicode_ci NOT NULL, + `ninja_portal_url` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci 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`), @@ -518,43 +519,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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `countries` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `capital` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `citizenship` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `country_code` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `currency` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `currency_code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `currency_sub_unit` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `full_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `iso_3166_2` varchar(2) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `iso_3166_3` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `region_code` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `sub_region_code` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `decimal_separator` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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, 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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `credit_invitations` ( - `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) COLLATE utf8mb4_unicode_ci NOT NULL, - `transaction_reference` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `message_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email_error` mediumtext COLLATE utf8mb4_unicode_ci, - `signature_base64` text COLLATE utf8mb4_unicode_ci, + `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, `signature_date` datetime DEFAULT NULL, `sent_date` datetime DEFAULT NULL, `viewed_date` datetime DEFAULT NULL, @@ -562,8 +563,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 COLLATE utf8mb4_unicode_ci, - `email_status` enum('delivered','bounced','spam') COLLATE utf8mb4_unicode_ci 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, 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`), @@ -579,45 +580,45 @@ 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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `credits` ( - `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `po_number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci 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 COLLATE utf8mb4_unicode_ci, - `backup` mediumtext COLLATE utf8mb4_unicode_ci, - `footer` text COLLATE utf8mb4_unicode_ci, - `public_notes` text COLLATE utf8mb4_unicode_ci, - `private_notes` text COLLATE utf8mb4_unicode_ci, - `terms` text COLLATE utf8mb4_unicode_ci, - `tax_name1` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` varchar(191) 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` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, `next_send_date` datetime DEFAULT NULL, `custom_surcharge1` decimal(20,6) DEFAULT NULL, `custom_surcharge2` decimal(20,6) DEFAULT NULL, @@ -641,7 +642,7 @@ CREATE TABLE `credits` ( `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(10) unsigned DEFAULT NULL, + `subscription_id` int unsigned DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `credits_company_id_number_unique` (`company_id`,`number`), KEY `credits_user_id_foreign` (`user_id`), @@ -655,15 +656,15 @@ CREATE TABLE `credits` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `currencies`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `currencies` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `symbol` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `precision` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `thousand_separator` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `decimal_separator` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, + `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', PRIMARY KEY (`id`) @@ -671,37 +672,37 @@ CREATE TABLE `currencies` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `date_formats`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `date_formats` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `format` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `format_moment` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `format_dart` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, + `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, 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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `datetime_formats` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `format` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `format_moment` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `format_dart` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, + `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, 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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `designs` ( - `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) COLLATE utf8mb4_unicode_ci NOT NULL, + `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 COLLATE utf8mb4_unicode_ci, + `design` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, @@ -714,31 +715,31 @@ CREATE TABLE `designs` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `documents`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `documents` ( - `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `preview` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `disk` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `hash` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `size` int(10) unsigned DEFAULT NULL, - `width` int(10) unsigned DEFAULT NULL, - `height` int(10) unsigned DEFAULT NULL, + `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` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` varchar(191) 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` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `documentable_id` int(10) unsigned NOT NULL, - `documentable_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, + `documentable_id` int unsigned NOT NULL, + `documentable_type` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `is_public` tinyint(1) NOT NULL DEFAULT '1', @@ -749,17 +750,17 @@ CREATE TABLE `documents` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `expense_categories`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `expense_categories` ( - `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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, `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) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#fff', + `color` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#fff', PRIMARY KEY (`id`), KEY `expense_categories_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `expense_categories_company_id_index` (`company_id`), @@ -768,48 +769,48 @@ 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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `expenses` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id` int 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(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, + `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', `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `tax_name3` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, `tax_rate3` decimal(20,6) NOT NULL DEFAULT '0.000000', `date` date DEFAULT NULL, `payment_date` date DEFAULT NULL, - `private_notes` text COLLATE utf8mb4_unicode_ci, - `public_notes` text COLLATE utf8mb4_unicode_ci, - `transaction_reference` text COLLATE utf8mb4_unicode_ci, + `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value1` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `project_id` int(10) unsigned DEFAULT NULL, + `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` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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', @@ -825,42 +826,42 @@ CREATE TABLE `expenses` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `failed_jobs`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `failed_jobs` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `connection` text COLLATE utf8mb4_unicode_ci NOT NULL, - `queue` text COLLATE utf8mb4_unicode_ci NOT NULL, - `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL, - `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL, + `id` bigint unsigned NOT NULL AUTO_INCREMENT, + `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, 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 `gateway_types`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `gateway_types` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `alias` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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, 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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `gateways` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `key` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `provider` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, + `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(10) unsigned NOT NULL DEFAULT '10000', - `site_url` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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 COLLATE utf8mb4_unicode_ci, - `default_gateway_type_id` int(10) unsigned NOT NULL DEFAULT '1', + `fields` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `default_gateway_type_id` int unsigned NOT NULL DEFAULT '1', `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, PRIMARY KEY (`id`), @@ -869,13 +870,13 @@ 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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `group_settings` ( - `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `settings` mediumtext COLLATE utf8mb4_unicode_ci, + `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', `deleted_at` timestamp(6) NULL DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, @@ -888,27 +889,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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `industries` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, + `id` int unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci 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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `invoice_invitations` ( - `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) COLLATE utf8mb4_unicode_ci NOT NULL, - `transaction_reference` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `message_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email_error` mediumtext COLLATE utf8mb4_unicode_ci, - `signature_base64` text COLLATE utf8mb4_unicode_ci, + `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, `signature_date` datetime DEFAULT NULL, `sent_date` datetime DEFAULT NULL, `viewed_date` datetime DEFAULT NULL, @@ -916,8 +917,8 @@ 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 COLLATE utf8mb4_unicode_ci, - `email_status` enum('delivered','bounced','spam') COLLATE utf8mb4_unicode_ci 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, 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`), @@ -933,44 +934,44 @@ 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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `invoices` ( - `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `po_number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci 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 COLLATE utf8mb4_unicode_ci, - `backup` mediumtext COLLATE utf8mb4_unicode_ci, - `footer` text COLLATE utf8mb4_unicode_ci, - `public_notes` text COLLATE utf8mb4_unicode_ci, - `private_notes` text COLLATE utf8mb4_unicode_ci, - `terms` text COLLATE utf8mb4_unicode_ci, - `tax_name1` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` varchar(191) 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` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, `next_send_date` datetime DEFAULT NULL, `custom_surcharge1` decimal(20,6) DEFAULT NULL, `custom_surcharge2` decimal(20,6) DEFAULT NULL, @@ -995,7 +996,7 @@ CREATE TABLE `invoices` ( `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(10) unsigned DEFAULT NULL, + `subscription_id` int unsigned DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `invoices_company_id_number_unique` (`company_id`,`number`), KEY `invoices_user_id_foreign` (`user_id`), @@ -1009,78 +1010,78 @@ CREATE TABLE `invoices` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `jobs`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `jobs` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `queue` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `payload` longtext COLLATE utf8mb4_unicode_ci 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, + `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, 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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `languages` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `locale` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, + `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, 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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `licenses` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id` int 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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `last_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `license_key` varchar(191) COLLATE utf8mb4_unicode_ci 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, `is_claimed` tinyint(1) DEFAULT NULL, - `transaction_reference` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `product_id` int(10) unsigned DEFAULT NULL, + `transaction_reference` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `product_id` int 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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `migrations` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `batch` int(11) NOT NULL, + `id` int unsigned NOT NULL AUTO_INCREMENT, + `migration` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `batch` int NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `password_resets`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `password_resets` ( - `email` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL, - `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `email` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci 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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `payment_hashes` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `hash` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `id` int unsigned NOT NULL AUTO_INCREMENT, + `hash` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `fee_total` decimal(16,4) NOT NULL, - `fee_invoice_id` int(10) unsigned DEFAULT NULL, - `data` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL, - `payment_id` int(10) unsigned DEFAULT 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, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, PRIMARY KEY (`id`), @@ -1090,25 +1091,25 @@ 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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `payment_libraries` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id` int unsigned NOT NULL AUTO_INCREMENT, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, - `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci 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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `payment_terms` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `num_days` int(11) DEFAULT NULL, - `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `company_id` int(10) unsigned DEFAULT NULL, - `user_id` int(10) unsigned DEFAULT NULL, + `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', `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, @@ -1122,24 +1123,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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `payment_types` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `gateway_type_id` int(11) DEFAULT NULL, + `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, 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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `paymentables` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `payment_id` int(10) unsigned NOT NULL, - `paymentable_id` int(10) unsigned NOT NULL, + `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) COLLATE utf8mb4_unicode_ci NOT NULL, + `paymentable_type` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, @@ -1150,42 +1151,42 @@ CREATE TABLE `paymentables` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `payments`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `payments` ( - `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, + `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', `date` date DEFAULT NULL, - `transaction_reference` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `payer_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `private_notes` text COLLATE utf8mb4_unicode_ci, + `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, `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(10) unsigned NOT NULL, - `exchange_currency_id` int(10) unsigned DEFAULT NULL, - `meta` text COLLATE utf8mb4_unicode_ci, - `custom_value1` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `payments_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `payments_client_contact_id_foreign` (`client_contact_id`), @@ -1203,28 +1204,28 @@ CREATE TABLE `payments` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `products`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `products` ( - `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` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `product_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `notes` text COLLATE utf8mb4_unicode_ci, + `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` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `tax_name3` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci 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, @@ -1240,29 +1241,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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `projects` ( - `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) COLLATE utf8mb4_unicode_ci NOT NULL, + `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', `due_date` date DEFAULT NULL, - `private_notes` text COLLATE utf8mb4_unicode_ci, + `private_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, `budgeted_hours` decimal(20,6) NOT NULL, - `custom_value1` text COLLATE utf8mb4_unicode_ci, - `custom_value2` text COLLATE utf8mb4_unicode_ci, - `custom_value3` text COLLATE utf8mb4_unicode_ci, - `custom_value4` text 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, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, - `public_notes` text COLLATE utf8mb4_unicode_ci, + `public_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `color` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#fff', + `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', PRIMARY KEY (`id`), KEY `projects_user_id_foreign` (`user_id`), KEY `projects_company_id_deleted_at_index` (`company_id`,`deleted_at`), @@ -1273,18 +1274,18 @@ CREATE TABLE `projects` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `quote_invitations`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `quote_invitations` ( - `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) COLLATE utf8mb4_unicode_ci NOT NULL, - `transaction_reference` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `message_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email_error` mediumtext COLLATE utf8mb4_unicode_ci, - `signature_base64` text COLLATE utf8mb4_unicode_ci, + `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, `signature_date` datetime DEFAULT NULL, `sent_date` datetime DEFAULT NULL, `viewed_date` datetime DEFAULT NULL, @@ -1292,8 +1293,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 COLLATE utf8mb4_unicode_ci, - `email_status` enum('delivered','bounced','spam') COLLATE utf8mb4_unicode_ci 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, 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`), @@ -1309,46 +1310,46 @@ 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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `quotes` ( - `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `po_number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci 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 COLLATE utf8mb4_unicode_ci, - `backup` mediumtext COLLATE utf8mb4_unicode_ci, - `footer` text COLLATE utf8mb4_unicode_ci, - `public_notes` text COLLATE utf8mb4_unicode_ci, - `private_notes` text COLLATE utf8mb4_unicode_ci, - `terms` text COLLATE utf8mb4_unicode_ci, - `tax_name1` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` varchar(191) 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` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, `custom_surcharge1` decimal(20,6) DEFAULT NULL, `custom_surcharge2` decimal(20,6) DEFAULT NULL, `custom_surcharge3` decimal(20,6) DEFAULT NULL, @@ -1371,7 +1372,7 @@ CREATE TABLE `quotes` ( `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(10) unsigned DEFAULT NULL, + `subscription_id` int unsigned DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `quotes_company_id_number_unique` (`company_id`,`number`), KEY `quotes_user_id_foreign` (`user_id`), @@ -1385,37 +1386,37 @@ 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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `recurring_expenses` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id` int 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(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, + `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_name2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_name3` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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, `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value1` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `category_id` int(10) unsigned DEFAULT NULL, + `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` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `category_id` int 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, @@ -1426,17 +1427,17 @@ CREATE TABLE `recurring_expenses` ( `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(10) unsigned DEFAULT NULL, - `number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `invoice_currency_id` int(10) unsigned DEFAULT NULL, - `currency_id` int(10) unsigned DEFAULT NULL, - `private_notes` text COLLATE utf8mb4_unicode_ci, - `public_notes` text COLLATE utf8mb4_unicode_ci, - `transaction_reference` text COLLATE utf8mb4_unicode_ci, - `frequency_id` int(10) unsigned NOT NULL, + `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, `last_sent_date` datetime DEFAULT NULL, `next_send_date` datetime DEFAULT NULL, - `remaining_cycles` int(11) DEFAULT NULL, + `remaining_cycles` int DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `recurring_expenses_company_id_number_unique` (`company_id`,`number`), KEY `recurring_expenses_company_id_deleted_at_index` (`company_id`,`deleted_at`), @@ -1448,26 +1449,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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `recurring_invoice_invitations` ( - `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) COLLATE utf8mb4_unicode_ci NOT NULL, + `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, `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `message_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email_error` mediumtext COLLATE utf8mb4_unicode_ci, - `signature_base64` text COLLATE utf8mb4_unicode_ci, + `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, `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') COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `email_status` enum('delivered','bounced','spam') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `cli_rec` (`client_contact_id`,`recurring_invoice_id`), KEY `recurring_invoice_invitations_user_id_foreign` (`user_id`), @@ -1483,54 +1484,54 @@ 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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `recurring_invoices` ( - `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 COLLATE utf8mb4_unicode_ci, + `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `po_number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, `date` date DEFAULT NULL, `due_date` datetime DEFAULT NULL, `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `line_items` mediumtext COLLATE utf8mb4_unicode_ci, - `backup` mediumtext COLLATE utf8mb4_unicode_ci, - `footer` text COLLATE utf8mb4_unicode_ci, - `public_notes` text COLLATE utf8mb4_unicode_ci, - `private_notes` text COLLATE utf8mb4_unicode_ci, - `terms` text COLLATE utf8mb4_unicode_ci, - `tax_name1` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` varchar(191) 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` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci 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(10) unsigned NOT NULL, + `frequency_id` int unsigned NOT NULL, `last_sent_date` datetime DEFAULT NULL, `next_send_date` datetime DEFAULT NULL, - `remaining_cycles` int(11) DEFAULT NULL, + `remaining_cycles` int 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) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'off', + `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(10) unsigned DEFAULT NULL, + `design_id` int 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, @@ -1540,11 +1541,11 @@ CREATE TABLE `recurring_invoices` ( `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `due_date_days` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci 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(10) unsigned DEFAULT NULL, + `subscription_id` int unsigned DEFAULT NULL, PRIMARY KEY (`id`), KEY `recurring_invoices_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `recurring_invoices_user_id_foreign` (`user_id`), @@ -1558,23 +1559,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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `recurring_quote_invitations` ( - `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) COLLATE utf8mb4_unicode_ci NOT NULL, - `transaction_reference` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `message_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email_error` mediumtext COLLATE utf8mb4_unicode_ci, - `signature_base64` text COLLATE utf8mb4_unicode_ci, + `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, `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') COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `email_status` enum('delivered','bounced','spam') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, @@ -1593,51 +1594,51 @@ 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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `recurring_quotes` ( - `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, + `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `po_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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, `date` date DEFAULT NULL, `due_date` datetime DEFAULT NULL, `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `line_items` mediumtext COLLATE utf8mb4_unicode_ci, - `backup` mediumtext COLLATE utf8mb4_unicode_ci, - `footer` text COLLATE utf8mb4_unicode_ci, - `public_notes` text COLLATE utf8mb4_unicode_ci, - `private_notes` text COLLATE utf8mb4_unicode_ci, - `terms` text COLLATE utf8mb4_unicode_ci, - `tax_name1` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` varchar(191) 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` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci 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(10) unsigned NOT NULL, + `frequency_id` int unsigned NOT NULL, `last_sent_date` datetime DEFAULT NULL, `next_send_date` datetime DEFAULT NULL, - `remaining_cycles` int(10) unsigned DEFAULT NULL, + `remaining_cycles` int 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) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'off', + `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', `custom_surcharge1` decimal(20,6) DEFAULT NULL, @@ -1648,11 +1649,11 @@ CREATE TABLE `recurring_quotes` ( `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `due_date_days` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci 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(10) unsigned DEFAULT NULL, + `subscription_id` int 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`), @@ -1667,46 +1668,46 @@ CREATE TABLE `recurring_quotes` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `sizes`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `sizes` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, + `id` int unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci 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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `subscriptions` ( - `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 COLLATE utf8mb4_unicode_ci, - `frequency_id` int(10) unsigned DEFAULT NULL, - `auto_bill` text COLLATE utf8mb4_unicode_ci, - `promo_code` text COLLATE utf8mb4_unicode_ci, + `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(10) unsigned NOT NULL, - `max_seats_limit` int(10) unsigned NOT NULL, + `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(10) unsigned NOT NULL, + `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 COLLATE utf8mb4_unicode_ci, - `refund_period` int(10) unsigned DEFAULT NULL, - `webhook_configuration` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL, + `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, `deleted_at` timestamp(6) NULL DEFAULT NULL, `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, - `currency_id` int(10) unsigned DEFAULT NULL, - `recurring_product_ids` text COLLATE utf8mb4_unicode_ci, - `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `group_id` int(10) unsigned 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', PRIMARY KEY (`id`), @@ -1717,16 +1718,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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `system_logs` ( - `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 COLLATE utf8mb4_unicode_ci NOT NULL, + `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, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, @@ -1739,19 +1740,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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `task_statuses` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `company_id` int(10) unsigned DEFAULT NULL, - `user_id` int(10) unsigned DEFAULT NULL, + `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', `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(11) DEFAULT NULL, - `color` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#fff', - `status_order` int(11) 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, PRIMARY KEY (`id`), KEY `task_statuses_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `task_statuses_user_id_foreign` (`user_id`), @@ -1761,34 +1762,34 @@ 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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `tasks` ( - `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, + `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, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, - `custom_value1` text COLLATE utf8mb4_unicode_ci, - `custom_value2` text COLLATE utf8mb4_unicode_ci, - `custom_value3` text COLLATE utf8mb4_unicode_ci, - `custom_value4` text COLLATE utf8mb4_unicode_ci, - `duration` int(10) unsigned DEFAULT NULL, - `description` text 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, + `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 COLLATE utf8mb4_unicode_ci, - `number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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(11) DEFAULT NULL, + `status_order` int DEFAULT NULL, PRIMARY KEY (`id`), KEY `tasks_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `tasks_user_id_foreign` (`user_id`), @@ -1803,15 +1804,15 @@ 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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `tax_rates` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `company_id` int(10) unsigned NOT NULL, - `user_id` int(10) unsigned DEFAULT NULL, + `id` int unsigned NOT NULL AUTO_INCREMENT, + `company_id` int unsigned NOT NULL, + `user_id` int 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) COLLATE utf8mb4_unicode_ci NOT 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', PRIMARY KEY (`id`), @@ -1824,55 +1825,89 @@ 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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `timezones` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `location` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `utc_offset` int(11) NOT NULL DEFAULT '0', + `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', 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 */; +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 COLLATE utf8mb4_unicode_ci, + `event_id` int unsigned NOT NULL, + `timestamp` int unsigned NOT NULL, + `payment_request` mediumtext COLLATE utf8mb4_unicode_ci, + `metadata` mediumtext 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, + 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 +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; +/*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `users`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `users` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `account_id` int(10) unsigned NOT NULL, - `first_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `last_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `phone` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `ip` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `device_token` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, + `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, `email_verified_at` timestamp NULL DEFAULT NULL, - `confirmation_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `theme_id` int(11) DEFAULT NULL, - `failed_logins` smallint(6) DEFAULT NULL, - `referral_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `oauth_user_id` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `oauth_user_token` text COLLATE utf8mb4_unicode_ci, - `oauth_provider_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `google_2fa_secret` text COLLATE utf8mb4_unicode_ci, - `accepted_terms_version` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `avatar` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `avatar_width` int(10) unsigned DEFAULT NULL, - `avatar_height` int(10) unsigned DEFAULT NULL, - `avatar_size` int(10) unsigned 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', `last_login` datetime DEFAULT NULL, - `signature` mediumtext COLLATE utf8mb4_unicode_ci, - `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value1` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` varchar(191) COLLATE utf8mb4_unicode_ci 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` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci 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` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `last_confirmed_email_address` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `oauth_user_refresh_token` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `last_confirmed_email_address` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, `has_password` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `users_email_unique` (`email`), @@ -1883,42 +1918,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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `vendor_contacts` ( - `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, + `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, `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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `last_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `phone` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value1` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` varchar(191) COLLATE utf8mb4_unicode_ci 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, + `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` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, `send_email` tinyint(1) NOT NULL DEFAULT '0', `email_verified_at` timestamp NULL DEFAULT NULL, - `confirmation_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `confirmation_code` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, `confirmed` tinyint(1) NOT NULL DEFAULT '0', `last_login` timestamp NULL DEFAULT NULL, - `failed_logins` smallint(6) DEFAULT NULL, - `oauth_user_id` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `oauth_provider_id` int(10) unsigned DEFAULT NULL, - `google_2fa_secret` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `accepted_terms_version` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `avatar` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `avatar_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `avatar_size` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `token` varchar(191) COLLATE utf8mb4_unicode_ci 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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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, 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`), @@ -1933,37 +1968,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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `vendors` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id` int 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(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) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `address1` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `address2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `city` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `state` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `postal_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `country_id` int(10) unsigned DEFAULT NULL, - `phone` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `private_notes` text COLLATE utf8mb4_unicode_ci, - `website` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `is_deleted` tinyint(4) NOT NULL DEFAULT '0', - `vat_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `transaction_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value1` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `vendor_hash` text COLLATE utf8mb4_unicode_ci, - `public_notes` text COLLATE utf8mb4_unicode_ci, - `id_number` varchar(191) COLLATE utf8mb4_unicode_ci 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` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `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, PRIMARY KEY (`id`), UNIQUE KEY `vendors_company_id_number_unique` (`company_id`,`number`), KEY `vendors_company_id_deleted_at_index` (`company_id`,`deleted_at`), @@ -1978,20 +2013,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 */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `webhooks` ( - `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, + `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) COLLATE utf8mb4_unicode_ci NOT NULL, - `format` enum('JSON','UBL') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'JSON', + `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', `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `rest_method` text COLLATE utf8mb4_unicode_ci, - `headers` text COLLATE utf8mb4_unicode_ci, + `rest_method` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `headers` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, PRIMARY KEY (`id`), KEY `subscriptions_company_id_foreign` (`company_id`), KEY `subscriptions_event_id_company_id_index` (`event_id`,`company_id`), @@ -2130,3 +2165,8 @@ INSERT INTO `migrations` VALUES (122,'2022_01_19_232436_add_kyd_currency',8); INSERT INTO `migrations` VALUES (123,'2022_01_27_223617_add_client_count_to_accounts_table',8); INSERT INTO `migrations` VALUES (124,'2022_02_06_091629_add_client_currency_conversion_to_companies_table',8); INSERT INTO `migrations` VALUES (125,'2022_02_25_015411_update_stripe_apple_domain_config',9); +INSERT INTO `migrations` VALUES (126,'2022_03_09_053508_transaction_events',10); +INSERT INTO `migrations` VALUES (127,'2022_03_24_090728_markdown_email_enabled_wysiwyg_editor',10); +INSERT INTO `migrations` VALUES (128,'2022_03_29_014025_reverse_apple_domain_for_hosted',10); +INSERT INTO `migrations` VALUES (129,'2022_04_22_115838_client_settings_parse_for_types',10); +INSERT INTO `migrations` VALUES (130,'2022_04_26_032252_convert_custom_fields_column_from_varchar_to_text',10); diff --git a/tests/Feature/Import/Zoho/ZohoTest.php b/tests/Feature/Import/Zoho/ZohoTest.php index f4e6c862c686..7d70890125cc 100644 --- a/tests/Feature/Import/Zoho/ZohoTest.php +++ b/tests/Feature/Import/Zoho/ZohoTest.php @@ -22,6 +22,7 @@ use App\Utils\Traits\MakesHash; use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Routing\Middleware\ThrottleRequests; use Illuminate\Support\Facades\Cache; +use Illuminate\Support\Facades\Session; use Illuminate\Support\Str; use Tests\MockAccountData; use Tests\TestCase; @@ -34,12 +35,14 @@ class ZohoTest extends TestCase { use MakesHash; use MockAccountData; - use DatabaseTransactions; + // use DatabaseTransactions; public function setUp(): void { parent::setUp(); + Session::start(); + $this->withoutMiddleware(ThrottleRequests::class); config(['database.default' => config('ninja.db.default')]); @@ -120,7 +123,7 @@ class ZohoTest extends TestCase Cache::put($hash . '-client', base64_encode($csv), 360); $csv_importer = new Zoho($data, $this->company); - + $count = $csv_importer->import('client'); $base_transformer = new BaseTransformer($this->company); From 0a483275ad04abbd73b004d5f562e670ba4ea933 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 26 Apr 2022 18:07:52 +1000 Subject: [PATCH 9/9] payable filters --- app/Filters/InvoiceFilters.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/Filters/InvoiceFilters.php b/app/Filters/InvoiceFilters.php index 1a85c6d1af30..657f0659f866 100644 --- a/app/Filters/InvoiceFilters.php +++ b/app/Filters/InvoiceFilters.php @@ -138,6 +138,18 @@ class InvoiceFilters extends QueryFilters }); } + public function payable(string $client_id) + { + if (strlen($client_id) == 0) { + return $this->builder; + } + + return $this->builder->whereIn('status_id', [Invoice::STATUS_DRAFT, Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL]) + ->where('balance', '>', 0) + ->where('is_deleted', 0) + ->where('client_id', $this->decodePrimaryKey($client_id)); + } + /** * Sorts the list based on $sort. *