From ae66bba0f12dd82a8f5c6ff5d3da485bd81056c5 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 7 Dec 2016 17:50:20 -0800 Subject: [PATCH] Fixes #3015 - increase size of state field in suppliers --- app/Models/Supplier.php | 2 +- ...20_increase_size_of_state_in_suppliers.php | 31 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 database/migrations/2016_12_07_173720_increase_size_of_state_in_suppliers.php diff --git a/app/Models/Supplier.php b/app/Models/Supplier.php index 72717f7546..439fb4273c 100755 --- a/app/Models/Supplier.php +++ b/app/Models/Supplier.php @@ -18,7 +18,7 @@ class Supplier extends SnipeModel 'address' => 'min:3|max:50', 'address2' => 'min:2|max:50', 'city' => 'min:3|max:255', - 'state' => 'min:0|max:2', + 'state' => 'min:0|max:32', 'country' => 'min:0|max:2', 'fax' => 'min:7|max:20', 'phone' => 'min:7|max:20', diff --git a/database/migrations/2016_12_07_173720_increase_size_of_state_in_suppliers.php b/database/migrations/2016_12_07_173720_increase_size_of_state_in_suppliers.php new file mode 100644 index 0000000000..1c1468d23a --- /dev/null +++ b/database/migrations/2016_12_07_173720_increase_size_of_state_in_suppliers.php @@ -0,0 +1,31 @@ +string('state', 32)->nullable()->default(null)->change(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('suppliers', function ($table) { + $table->string('state', 2)->nullable()->default(null)->change(); + }); + } +}