Add endpoint logic necessary to reset server states if they get stuck installing/restoring when wings restarts

This commit is contained in:
Dane Everitt 2021-02-23 21:20:02 -08:00
parent 3b60004392
commit 1b2c4931ee
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
3 changed files with 106 additions and 0 deletions

View file

@ -0,0 +1,39 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddIndexForServerAndAction extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('audit_logs', function (Blueprint $table) {
// Doing the index in this order lets me use the action alone without the server
// or I can later include the server to also filter down at an even more specific
// level.
//
// Ordering the other way around would require a second index for only "action" in
// order to query a specific action type for any server. Remeber, indexes run left
// to right in MySQL.
$table->index(['action', 'server_id']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('audit_logs', function (Blueprint $table) {
$table->dropIndex(['action', 'server_id']);
});
}
}