diff --git a/app/Listeners/Update/V30/Version3015.php b/app/Listeners/Update/V30/Version3015.php new file mode 100644 index 000000000..44124da7a --- /dev/null +++ b/app/Listeners/Update/V30/Version3015.php @@ -0,0 +1,43 @@ +skipThisUpdate($event)) { + return; + } + + Log::channel('stdout')->info('Updating to 3.0.15 version...'); + + $this->updateDatabase(); + + Log::channel('stdout')->info('Done!'); + } + + public function updateDatabase(): void + { + Log::channel('stdout')->info('Updating database...'); + + Artisan::call('migrate', ['--force' => true]); + + Log::channel('stdout')->info('Database updated.'); + } +} diff --git a/app/Providers/Event.php b/app/Providers/Event.php index 13c2b36ad..b9a90a85e 100644 --- a/app/Providers/Event.php +++ b/app/Providers/Event.php @@ -23,6 +23,7 @@ class Event extends Provider 'App\Listeners\Update\V30\Version309', 'App\Listeners\Update\V30\Version3013', 'App\Listeners\Update\V30\Version3014', + 'App\Listeners\Update\V30\Version3015', ], 'Illuminate\Auth\Events\Login' => [ 'App\Listeners\Auth\Login', diff --git a/database/migrations/2022_08_29_000000_core_v3015.php b/database/migrations/2022_08_29_000000_core_v3015.php new file mode 100644 index 000000000..0da0db054 --- /dev/null +++ b/database/migrations/2022_08_29_000000_core_v3015.php @@ -0,0 +1,53 @@ +index('contact_id'); + }); + + // User Companies + Schema::table('user_companies', function(Blueprint $table) { + $table->index('user_id'); + $table->index('company_id'); + }); + + // User Roles + Schema::table('user_companies', function(Blueprint $table) { + $table->index('user_id'); + $table->index('role_id'); + }); + + // Transactions + Schema::table('transactions', function(Blueprint $table) { + $table->index('number'); + }); + + // Roles + Schema::table('roles', function(Blueprint $table) { + $table->index('name'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +};