Merge branch 'develop' into feature/service-changes

This commit is contained in:
Dane Everitt 2016-12-14 16:53:53 -05:00
commit fc38b09e1f
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
169 changed files with 2268 additions and 2289 deletions

View file

@ -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;');
}
}

View file

@ -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,
]
);
}

View file

@ -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,
]
);
}

View file

@ -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
{
/**

View file

@ -1,7 +1,5 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class RenameDoubleInsurgency extends Migration

View file

@ -24,7 +24,6 @@ class BuildApiLogTable extends Migration
$table->text('user_agent');
$table->ipAddress('request_ip');
$table->timestampsTz();
});
}

View file

@ -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;
}
}

View file

@ -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.

View file

@ -34,5 +34,4 @@ class AddForeignPermissions extends Migration
$table->dropIndex('permissions_server_id_foreign');
});
}
}

View file

@ -44,5 +44,4 @@ class AddForeignServerVariables extends Migration
MODIFY COLUMN variable_id MEDIUMINT(8) UNSIGNED NOT NULL
');
}
}

View file

@ -34,4 +34,4 @@ class AddForeignServiceVariables extends Migration
DB::statement('ALTER TABLE service_variables MODIFY option_id MEDIUMINT(8) UNSIGNED NOT NULL');
}
}
}

View file

@ -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})$/',
]);
});
}
/**

View file

@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddConfigurableUploadLimit extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('nodes', function (Blueprint $table) {
$table->unsignedInteger('upload_size')->after('disk_overallocate')->default(100);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('nodes', function (Blueprint $table) {
$table->dropColumn('upload_size');
});
}
}

View file

@ -0,0 +1,77 @@
<?php
use Illuminate\Database\Migrations\Migration;
class CorrectServiceVariables extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
DB::transaction(function () {
// Modify Default Spigot Startup Line
DB::table('service_options')->where([
['name', 'Spigot'],
['tag', 'spigot'],
['startup', '-Xms128M -Xmx{{SERVER_MEMORY}}M -Djline.terminal=jline.UnsupportedTerminal -jar {{SERVER_JARFILE}}'],
])->update([
'startup' => null,
]);
// Correct Spigot Version Checking
DB::table('service_variables')->where([
['name', 'Spigot Version'],
['env_variable', 'DL_VERSION'],
['default_value', 'latest'],
['regex', '/^(latest|[a-zA-Z0-9_\.-]{5,6})$/'],
])->update([
'regex' => '/^(latest|[a-zA-Z0-9_\.-]{3,7})$/',
]);
// Correct Vanilla Version Checking (as well as naming)
DB::table('service_variables')->where([
['name', 'Server Jar File'],
['env_variable', 'VANILLA_VERSION'],
['default_value', 'latest'],
['regex', '/^(latest|[a-zA-Z0-9_\.-]{5,6})$/'],
])->update([
'name' => 'Server Version',
'regex' => '/^(latest|[a-zA-Z0-9_\.-]{3,7})$/',
]);
// Update Sponge Version Checking and Update Default Version
DB::table('service_variables')->where([
['name', 'Sponge Version'],
['env_variable', 'SPONGE_VERSION'],
['default_value', '1.8.9-4.2.0-BETA-351'],
['regex', '/^(.*)$/'],
])->update([
'default_value' => '1.10.2-5.1.0-BETA-359',
'regex' => '/^([a-zA-Z0-9.\-_]+)$/',
]);
// Update Bungeecord Version Checking
DB::table('service_variables')->where([
['name', 'Bungeecord Version'],
['env_variable', 'BUNGEE_VERSION'],
['default_value', 'latest'],
['regex', '/^(latest|[\d]{3,5})$/'],
])->update([
'regex' => '/^(latest|[\d]{1,6})$/',
]);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
// do nothing
}
}