Commit
fe196cc352bb19b4b21429cf516c6335d3ddac5c
Exists in
master
and in
29 other branches
add_you_are_here_breadcrumbs_label, api_for_colab, backup_not_prod, button_suspension_points_remove, create_institution_bootstrap_modal, disable_email_dev, fix_edit_institution, fix_edit_software_with_another_license, fix_list_style_inside_article, fix_members_pagination, fix_models_translations, fix_no_license, fix_software_block_migration, fix_validations_and_tests, gov-user-refactoring-rails4, header_fix, kalibro-processor-package, lxc, margin_fix, refactor_software_for_sisp, remove_secondary_email_from_user, review_message, signals_user_noosfero, sisp_dev_master, software_as_organization, software_catalog_style_fix, software_catalog_style_fixes, thread_dropdown, update_softwares_boxes
Created migration to remove softwares without community
- For some reason, there are still softwares without relation with community.
The quick solution was to delete this softwares, since they are test softwares.
Signed-off-by Gabriel Silva <gabriel93.silva@gmail.com>
Signed-off-by Gustavo Coelho <gust.rod.coelho@gmail.com>
Signed-off-by: Arthur Del Esposte <arthurmde@gmail.com>
| @@ -0,0 +1,9 @@ |
| @@ -0,0 +1,9 @@ |
| |
1
| +class RemoveSoftwaresWithoutCommunity < ActiveRecord::Migration |
| |
2
| + def up |
| |
3
| + execute('DELETE FROM software_infos where community_id NOT IN (SELECT id FROM profiles)') |
| |
4
| + end |
| |
5
| + |
| |
6
| + def down |
| |
7
| + say "This migration can't be reverted!" |
| |
8
| + end |
| |
9
| +end |