From c96c91ec8818c00c8bee01aa0e9fb05fa93ad4f3 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 24 Jan 2016 09:21:20 +0200 Subject: [PATCH] Fix for #647 --- .../2016_01_17_155725_add_quote_to_invoice_option.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/database/migrations/2016_01_17_155725_add_quote_to_invoice_option.php b/database/migrations/2016_01_17_155725_add_quote_to_invoice_option.php index f3183ad8f2..2a9b420f6a 100644 --- a/database/migrations/2016_01_17_155725_add_quote_to_invoice_option.php +++ b/database/migrations/2016_01_17_155725_add_quote_to_invoice_option.php @@ -18,10 +18,12 @@ class AddQuoteToInvoiceOption extends Migration }); // we need to create the last status to resolve a foreign key constraint - DB::table('invoice_statuses')->insert([ - 'id' => 6, - 'name' => 'Paid' - ]); + if (DB::table('invoice_statuses')->count() == 5) { + DB::table('invoice_statuses')->insert([ + 'id' => 6, + 'name' => 'Paid' + ]); + } DB::table('invoices') ->whereIn('invoice_status_id', [4, 5])