Add endpoint logic necessary to reset server states if they get stuck installing/restoring when wings restarts
This commit is contained in:
parent
3b60004392
commit
1b2c4931ee
3 changed files with 106 additions and 0 deletions
|
@ -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']);
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue