From 274f3511f5b8b465ab1f5c650214cb1c40738855 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 20 Jun 2017 12:23:32 -0700 Subject: [PATCH] Fixes new setup migration for auto-increment --- ...7_06_14_122059_add_next_autoincrement_to_settings.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/database/migrations/2017_06_14_122059_add_next_autoincrement_to_settings.php b/database/migrations/2017_06_14_122059_add_next_autoincrement_to_settings.php index c574a2d6cb..a0c919d99e 100644 --- a/database/migrations/2017_06_14_122059_add_next_autoincrement_to_settings.php +++ b/database/migrations/2017_06_14_122059_add_next_autoincrement_to_settings.php @@ -26,9 +26,12 @@ class AddNextAutoincrementToSettings extends Migration }); \Log::debug('Setting '.$next.' as default auto-increment'); - $settings = App\Models\Setting::first(); - $settings->next_auto_tag_base = $next; - $settings->save(); + + if ($settings = App\Models\Setting::first()) { + $settings->next_auto_tag_base = $next; + $settings->save(); + } + }