added more indexes
This commit is contained in:
parent
f7c8f4b785
commit
4c62e391b7
29
app/Listeners/Update/V20/Version2014.php
Normal file
29
app/Listeners/Update/V20/Version2014.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Listeners\Update\V20;
|
||||
|
||||
use App\Abstracts\Listeners\Update as Listener;
|
||||
use App\Events\Install\UpdateFinished as Event;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
|
||||
class Version2014 extends Listener
|
||||
{
|
||||
const ALIAS = 'core';
|
||||
|
||||
const VERSION = '2.0.14';
|
||||
|
||||
/**
|
||||
* Handle the event.
|
||||
*
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handle(Event $event)
|
||||
{
|
||||
if ($this->skipThisUpdate($event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Artisan::call('migrate', ['--force' => true]);
|
||||
}
|
||||
}
|
@ -20,6 +20,7 @@ class Event extends Provider
|
||||
'App\Listeners\Update\V20\Version207',
|
||||
'App\Listeners\Update\V20\Version208',
|
||||
'App\Listeners\Update\V20\Version209',
|
||||
'App\Listeners\Update\V20\Version2014',
|
||||
],
|
||||
'Illuminate\Auth\Events\Login' => [
|
||||
'App\Listeners\Auth\Login',
|
||||
|
44
database/migrations/2020_06_09_000000_core_v2014.php
Normal file
44
database/migrations/2020_06_09_000000_core_v2014.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CoreV2014 extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$doc_types = ['invoice', 'bill'];
|
||||
$doc_tables = ['histories', 'items', 'item_taxes', 'totals'];
|
||||
|
||||
foreach ($doc_types as $doc_type) {
|
||||
foreach ($doc_tables as $doc_table) {
|
||||
Schema::table($doc_type . '_' . $doc_table, function (Blueprint $table) use ($doc_type) {
|
||||
$table->index($doc_type . '_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Schema::table('transactions', function (Blueprint $table) {
|
||||
$table->index('account_id');
|
||||
$table->index('category_id');
|
||||
$table->index('contact_id');
|
||||
$table->index('document_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user