From a4d7985e51304dbd616177ee9b4ab712cc924756 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sat, 2 Mar 2019 14:27:01 -0800 Subject: [PATCH] [#1500] Fix allocation limit being required even though it isn't used. --- app/Models/Server.php | 2 +- ...2328_set_allocation_limit_default_null.php | 32 +++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 database/migrations/2019_03_02_142328_set_allocation_limit_default_null.php diff --git a/app/Models/Server.php b/app/Models/Server.php index 5d42cf86b..8dc675726 100644 --- a/app/Models/Server.php +++ b/app/Models/Server.php @@ -63,7 +63,7 @@ class Server extends Model implements CleansAttributes, ValidableContract 'image' => 'required', 'startup' => 'required', 'database_limit' => 'present', - 'allocation_limit' => 'present', + 'allocation_limit' => 'sometimes', ]; /** diff --git a/database/migrations/2019_03_02_142328_set_allocation_limit_default_null.php b/database/migrations/2019_03_02_142328_set_allocation_limit_default_null.php new file mode 100644 index 000000000..d91ce6372 --- /dev/null +++ b/database/migrations/2019_03_02_142328_set_allocation_limit_default_null.php @@ -0,0 +1,32 @@ +unsignedInteger('allocation_limit')->nullable()->default(null)->change(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('servers', function (Blueprint $table) { + $table->unsignedInteger('allocation_limit')->nullable()->default(0)->change(); + }); + } +}