Skip to content

Commit a4d7985

Browse files
committed
[pterodactyl#1500] Fix allocation limit being required even though it isn't used.
1 parent 01e006a commit a4d7985

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

app/Models/Server.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class Server extends Model implements CleansAttributes, ValidableContract
6363
'image' => 'required',
6464
'startup' => 'required',
6565
'database_limit' => 'present',
66-
'allocation_limit' => 'present',
66+
'allocation_limit' => 'sometimes',
6767
];
6868

6969
/**
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
use Illuminate\Support\Facades\Schema;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Database\Migrations\Migration;
6+
7+
class SetAllocationLimitDefaultNull extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
Schema::table('servers', function (Blueprint $table) {
17+
$table->unsignedInteger('allocation_limit')->nullable()->default(null)->change();
18+
});
19+
}
20+
21+
/**
22+
* Reverse the migrations.
23+
*
24+
* @return void
25+
*/
26+
public function down()
27+
{
28+
Schema::table('servers', function (Blueprint $table) {
29+
$table->unsignedInteger('allocation_limit')->nullable()->default(0)->change();
30+
});
31+
}
32+
}

0 commit comments

Comments
 (0)