From 08bbd1ffa1f1110f3741081fc4753f3e76cebb12 Mon Sep 17 00:00:00 2001 From: Andrew Radev Date: Sun, 12 Jul 2015 11:22:19 +0300 Subject: [PATCH] Fix migration that fails in build --- ...30182857_populate_conference_id_in_personal_profiles.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/db/migrate/20150530182857_populate_conference_id_in_personal_profiles.rb b/db/migrate/20150530182857_populate_conference_id_in_personal_profiles.rb index ff151ea..fdbd02d 100644 --- a/db/migrate/20150530182857_populate_conference_id_in_personal_profiles.rb +++ b/db/migrate/20150530182857_populate_conference_id_in_personal_profiles.rb @@ -6,7 +6,10 @@ end class PopulateConferenceIdInPersonalProfiles < ActiveRecord::Migration def change - conference = Conference.first! - PersonalProfile.where(conference_id: nil).update_all(conference_id: conference.id) + conference = Conference.first + + if conference + PersonalProfile.where(conference_id: nil).update_all(conference_id: conference.id) + end end end