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