From 92d1d6562d9d3ebf4dbc35ef0d764a67f158b395 Mon Sep 17 00:00:00 2001 From: Patrick Samson Date: Mon, 3 Nov 2014 19:31:28 -0500 Subject: [PATCH 1/2] Fixed SQL query on dashboard It did not work properly before on Postgres --- app/controllers/DashboardController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/DashboardController.php b/app/controllers/DashboardController.php index a1d7a6f220fe..72f060ad0870 100644 --- a/app/controllers/DashboardController.php +++ b/app/controllers/DashboardController.php @@ -19,7 +19,7 @@ class DashboardController extends \BaseController { ->groupBy('accounts.id') ->first(); - $select = DB::raw('SUM(clients.paid_to_date) value'); + $select = DB::raw('SUM(clients.paid_to_date) as value'); $totalIncome = DB::table('accounts') ->select($select) @@ -62,4 +62,4 @@ class DashboardController extends \BaseController { return View::make('dashboard', $data); } -} \ No newline at end of file +} From 0148407a402a4072cc7caa2dfc0ba830674b6875 Mon Sep 17 00:00:00 2001 From: Patrick Samson Date: Mon, 3 Nov 2014 19:44:12 -0500 Subject: [PATCH 2/2] Contacts last_login column should be nullable --- .../migrations/2013_11_05_180133_confide_setup_users_table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/database/migrations/2013_11_05_180133_confide_setup_users_table.php b/app/database/migrations/2013_11_05_180133_confide_setup_users_table.php index e295b176b1e3..d00a491ca517 100755 --- a/app/database/migrations/2013_11_05_180133_confide_setup_users_table.php +++ b/app/database/migrations/2013_11_05_180133_confide_setup_users_table.php @@ -279,7 +279,7 @@ class ConfideSetupUsersTable extends Migration { $t->string('last_name')->nullable(); $t->string('email')->nullable(); $t->string('phone')->nullable(); - $t->timestamp('last_login'); + $t->timestamp('last_login')->nullable(); $t->foreign('client_id')->references('id')->on('clients')->onDelete('cascade'); $t->foreign('user_id')->references('id')->on('users')->onDelete('cascade');;