From 4de02a20556018c58a13de42b258c3b2e779ce09 Mon Sep 17 00:00:00 2001 From: Arthur Del Esposte Date: Fri, 22 May 2015 18:40:31 +0000 Subject: [PATCH] Add migration to remove broken profile suggestions --- db/migrate/20150507204849_remove_broken_profile_suggestions.rb | 9 +++++++++ 1 file changed, 9 insertions(+), 0 deletions(-) create mode 100644 db/migrate/20150507204849_remove_broken_profile_suggestions.rb diff --git a/db/migrate/20150507204849_remove_broken_profile_suggestions.rb b/db/migrate/20150507204849_remove_broken_profile_suggestions.rb new file mode 100644 index 0000000..6a69d78 --- /dev/null +++ b/db/migrate/20150507204849_remove_broken_profile_suggestions.rb @@ -0,0 +1,9 @@ +class RemoveBrokenProfileSuggestions < ActiveRecord::Migration + def up + execute("DELETE FROM profile_suggestions WHERE suggestion_id NOT IN (SELECT id from profiles)") + end + + def down + say "this migration can't be reverted" + end +end -- libgit2 0.21.2