Apply fixes from StyleCI
This commit is contained in:
parent
a1d3bbf73d
commit
c1fb0a665f
150 changed files with 1558 additions and 1760 deletions
|
@ -1,6 +1,5 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddNullableFieldLastrun extends Migration
|
||||
|
@ -13,7 +12,7 @@ class AddNullableFieldLastrun extends Migration
|
|||
public function up()
|
||||
{
|
||||
$table = DB::getQueryGrammar()->wrapTable('tasks');
|
||||
DB::statement('ALTER TABLE '.$table.' CHANGE `last_run` `last_run` TIMESTAMP NULL;');
|
||||
DB::statement('ALTER TABLE ' . $table . ' CHANGE `last_run` `last_run` TIMESTAMP NULL;');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -24,6 +23,6 @@ class AddNullableFieldLastrun extends Migration
|
|||
public function down()
|
||||
{
|
||||
$table = DB::getQueryGrammar()->wrapTable('tasks');
|
||||
DB::statement('ALTER TABLE '.$table.' CHANGE `last_run` `last_run` TIMESTAMP;');
|
||||
DB::statement('ALTER TABLE ' . $table . ' CHANGE `last_run` `last_run` TIMESTAMP;');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,12 +17,12 @@ class AddIpAlias extends Migration
|
|||
});
|
||||
|
||||
$allocations = DB::select('SELECT id, ip FROM allocations');
|
||||
foreach($allocations as $allocation) {
|
||||
foreach ($allocations as $allocation) {
|
||||
DB::update(
|
||||
'UPDATE allocations SET ip_alias = :ip WHERE id = :id',
|
||||
[
|
||||
'ip' => $allocation->ip,
|
||||
'id' => $allocation->id
|
||||
'id' => $allocation->id,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
|
@ -18,13 +18,13 @@ class ModifyIpStorageMethod extends Migration
|
|||
|
||||
// Parse All Servers
|
||||
$servers = DB::select('SELECT id, ip, port, node FROM servers');
|
||||
foreach($servers as $server) {
|
||||
foreach ($servers as $server) {
|
||||
$allocation = DB::select(
|
||||
'SELECT id FROM allocations WHERE ip = :ip AND port = :port AND node = :node',
|
||||
[
|
||||
'ip' => $server->ip,
|
||||
'port' => $server->port,
|
||||
'node' => $server->node
|
||||
'node' => $server->node,
|
||||
]
|
||||
);
|
||||
|
||||
|
@ -33,7 +33,7 @@ class ModifyIpStorageMethod extends Migration
|
|||
'UPDATE servers SET allocation = :alocid WHERE id = :id',
|
||||
[
|
||||
'alocid' => $allocation[0]->id,
|
||||
'id' => $server->id
|
||||
'id' => $server->id,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@ -44,7 +44,6 @@ class ModifyIpStorageMethod extends Migration
|
|||
$table->dropColumn('ip');
|
||||
$table->dropColumn('port');
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -54,7 +53,6 @@ class ModifyIpStorageMethod extends Migration
|
|||
*/
|
||||
public function down()
|
||||
{
|
||||
|
||||
Schema::table('servers', function (Blueprint $table) {
|
||||
$table->text('ip')->after('allocation');
|
||||
$table->integer('port')->unsigned()->after('ip');
|
||||
|
@ -62,8 +60,8 @@ class ModifyIpStorageMethod extends Migration
|
|||
|
||||
// Find the allocations and reset the servers...
|
||||
$servers = DB::select('SELECT id, allocation FROM servers');
|
||||
foreach($servers as $server) {
|
||||
$allocation = DB::select('SELECT * FROM allocations WHERE id = :alocid', [ 'alocid' => $server->allocation ]);
|
||||
foreach ($servers as $server) {
|
||||
$allocation = DB::select('SELECT * FROM allocations WHERE id = :alocid', ['alocid' => $server->allocation]);
|
||||
|
||||
if (isset($allocation[0])) {
|
||||
DB::update(
|
||||
|
@ -71,7 +69,7 @@ class ModifyIpStorageMethod extends Migration
|
|||
[
|
||||
'ip' => $allocation[0]->ip,
|
||||
'port' => $allocation[0]->port,
|
||||
'id' => $server->id
|
||||
'id' => $server->id,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
|
@ -4,8 +4,6 @@ use Illuminate\Support\Facades\Schema;
|
|||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
use Pterodactyl\Models\Server;
|
||||
|
||||
class AddDockerImageColumn extends Migration
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class RenameDoubleInsurgency extends Migration
|
||||
|
|
|
@ -24,7 +24,6 @@ class BuildApiLogTable extends Migration
|
|||
$table->text('user_agent');
|
||||
$table->ipAddress('request_ip');
|
||||
$table->timestampsTz();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class UpdateMisnamedBungee extends Migration
|
||||
|
@ -14,7 +12,7 @@ class UpdateMisnamedBungee extends Migration
|
|||
public function up()
|
||||
{
|
||||
DB::table('service_variables')->select('env_variable')->where('env_variable', 'BUNGE_VERSION')->update([
|
||||
'env_variable' => 'BUNGEE_VERSION'
|
||||
'env_variable' => 'BUNGEE_VERSION',
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -25,6 +23,5 @@ class UpdateMisnamedBungee extends Migration
|
|||
*/
|
||||
public function down()
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,17 +12,17 @@ class AddForeignAllocations extends Migration
|
|||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
DB::statement('ALTER TABLE allocations
|
||||
{
|
||||
DB::statement('ALTER TABLE allocations
|
||||
MODIFY COLUMN assigned_to INT(10) UNSIGNED NULL,
|
||||
MODIFY COLUMN node INT(10) UNSIGNED NOT NULL
|
||||
');
|
||||
|
||||
Schema::table('allocations', function (Blueprint $table) {
|
||||
$table->foreign('assigned_to')->references('id')->on('servers');
|
||||
$table->foreign('node')->references('id')->on('nodes');
|
||||
});
|
||||
}
|
||||
Schema::table('allocations', function (Blueprint $table) {
|
||||
$table->foreign('assigned_to')->references('id')->on('servers');
|
||||
$table->foreign('node')->references('id')->on('nodes');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
|
|
|
@ -34,5 +34,4 @@ class AddForeignPermissions extends Migration
|
|||
$table->dropIndex('permissions_server_id_foreign');
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -44,5 +44,4 @@ class AddForeignServerVariables extends Migration
|
|||
MODIFY COLUMN variable_id MEDIUMINT(8) UNSIGNED NOT NULL
|
||||
');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -34,4 +34,4 @@ class AddForeignServiceVariables extends Migration
|
|||
|
||||
DB::statement('ALTER TABLE service_variables MODIFY option_id MEDIUMINT(8) UNSIGNED NOT NULL');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddArkServiceOptionFixed extends Migration
|
||||
|
@ -17,7 +15,7 @@ class AddArkServiceOptionFixed extends Migration
|
|||
$service = DB::table('services')->select('id')->where('author', 'ptrdctyl-v040-11e6-8b77-86f30ca893d3')->where('name', 'Source Engine')->first();
|
||||
|
||||
// No SRCDS Service, Skipping
|
||||
if (!$service) {
|
||||
if (! $service) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -33,7 +31,7 @@ class AddArkServiceOptionFixed extends Migration
|
|||
'tag' => 'ark',
|
||||
'docker_image' => 'quay.io/pterodactyl/srcds:ark',
|
||||
'executable' => './ShooterGameServer',
|
||||
'startup' => 'TheIsland?listen?ServerPassword={{ARK_PASSWORD}}?ServerAdminPassword={{ARK_ADMIN_PASSWORD}}?Port={{SERVER_PORT}}?MaxPlayers={{SERVER_MAX_PLAYERS}}'
|
||||
'startup' => 'TheIsland?listen?ServerPassword={{ARK_PASSWORD}}?ServerAdminPassword={{ARK_ADMIN_PASSWORD}}?Port={{SERVER_PORT}}?MaxPlayers={{SERVER_MAX_PLAYERS}}',
|
||||
]);
|
||||
|
||||
DB::table('service_variables')->insert([
|
||||
|
@ -45,7 +43,7 @@ class AddArkServiceOptionFixed extends Migration
|
|||
'user_viewable' => 1,
|
||||
'user_editable' => 1,
|
||||
'required' => 0,
|
||||
'regex' => '/^(\w\.*)$/'
|
||||
'regex' => '/^(\w\.*)$/',
|
||||
]);
|
||||
|
||||
DB::table('service_variables')->insert([
|
||||
|
@ -57,7 +55,7 @@ class AddArkServiceOptionFixed extends Migration
|
|||
'user_viewable' => 1,
|
||||
'user_editable' => 1,
|
||||
'required' => 0,
|
||||
'regex' => '/^(\w\.*)$/'
|
||||
'regex' => '/^(\w\.*)$/',
|
||||
]);
|
||||
|
||||
DB::table('service_variables')->insert([
|
||||
|
@ -69,10 +67,9 @@ class AddArkServiceOptionFixed extends Migration
|
|||
'user_viewable' => 1,
|
||||
'user_editable' => 1,
|
||||
'required' => 1,
|
||||
'regex' => '/^(\d{1,4})$/'
|
||||
'regex' => '/^(\d{1,4})$/',
|
||||
]);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CorrectServiceVariables extends Migration
|
||||
|
@ -38,7 +36,7 @@ class CorrectServiceVariables extends Migration
|
|||
['name', 'Server Jar File'],
|
||||
['env_variable', 'VANILLA_VERSION'],
|
||||
['default_value', 'latest'],
|
||||
['regex', '/^(latest|[a-zA-Z0-9_\.-]{5,6})$/']
|
||||
['regex', '/^(latest|[a-zA-Z0-9_\.-]{5,6})$/'],
|
||||
])->update([
|
||||
'name' => 'Server Version',
|
||||
'regex' => '/^(latest|[a-zA-Z0-9_\.-]{3,7})$/',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue