Fixes for indexes

This commit is contained in:
David Bomba 2022-07-10 10:56:37 +10:00
parent 3ad3a2d8ea
commit 15da7b841a
2 changed files with 12 additions and 1 deletions

View File

@ -39,7 +39,7 @@ class VersionCheck implements ShouldQueue
nlog("latest version = {$version_file}");
if ($version_file) {
if (Ninja::isSelfHost() && $version_file) {
Account::whereNotNull('id')->update(['latest_version' => $version_file]);
}

View File

@ -16,6 +16,17 @@ class AddIndexToPaymentHash extends Migration
Schema::table('payment_hashes', function (Blueprint $table) {
$table->string('hash', 255)->index()->change();
});
Schema::table('activities', function (Blueprint $table) {
$table->index(['quote_id', 'company_id']);
$table->index(['recurring_invoice_id', 'company_id']);
$table->index(['purchase_order_id', 'company_id']);
$table->index(['vendor_contact_id', 'company_id']);
});
Schema::table('products', function (Blueprint $table) {
$table->index(['company_id', 'user_id', 'assigned_user_id', 'updated_at'],'pro_co_us_up_index');
});
}
/**