From 6683062d9e349694ded4a869282504c3ef800cd0 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 3 Feb 2016 09:10:54 +1100 Subject: [PATCH] fixed bug in migration --- .../2016_02_01_135956_add_source_currency_to_expenses.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/database/migrations/2016_02_01_135956_add_source_currency_to_expenses.php b/database/migrations/2016_02_01_135956_add_source_currency_to_expenses.php index bdce9926ea..16c2f38a10 100644 --- a/database/migrations/2016_02_01_135956_add_source_currency_to_expenses.php +++ b/database/migrations/2016_02_01_135956_add_source_currency_to_expenses.php @@ -20,6 +20,10 @@ class AddSourceCurrencyToExpenses extends Migration $table->renameColumn('currency_id', 'invoice_currency_id'); $table->unsignedInteger('expense_currency_id'); + }); + + Schema::table('expenses', function (Blueprint $table) { + // set account value so we're able to create foreign constraint DB::statement('update expenses e left join accounts a on a.id = e.account_id