From fe196cc352bb19b4b21429cf516c6335d3ddac5c Mon Sep 17 00:00:00 2001 From: Tallys Martins Date: Fri, 6 Nov 2015 16:25:19 -0200 Subject: [PATCH] Created migration to remove softwares without community --- src/noosfero-spb/spb_migrations/db/migrate/20151106172419_remove_softwares_without_community.rb | 9 +++++++++ 1 file changed, 9 insertions(+), 0 deletions(-) create mode 100644 src/noosfero-spb/spb_migrations/db/migrate/20151106172419_remove_softwares_without_community.rb diff --git a/src/noosfero-spb/spb_migrations/db/migrate/20151106172419_remove_softwares_without_community.rb b/src/noosfero-spb/spb_migrations/db/migrate/20151106172419_remove_softwares_without_community.rb new file mode 100644 index 0000000..fbb7df4 --- /dev/null +++ b/src/noosfero-spb/spb_migrations/db/migrate/20151106172419_remove_softwares_without_community.rb @@ -0,0 +1,9 @@ +class RemoveSoftwaresWithoutCommunity < ActiveRecord::Migration + def up + execute('DELETE FROM software_infos where community_id NOT IN (SELECT id FROM profiles)') + end + + def down + say "This migration can't be reverted!" + end +end -- libgit2 0.21.2