Commit
17b176dd160f75386558eae28d63997e88a45c50
Exists in
master
and in
53 other branches
add_sisp_to_chef, add_super_archives_plugin, automates_core_packing, backup_not_prod, changes_in_buttons_on_content_panel, colab_automated_login, colab_spb_plugin_recipe, colab_widgets_settings, disable_email_dev, fix_breadcrumbs_position, fix_categories_software_link, fix_edit_institution, fix_edit_software_with_another_license, fix_get_license_info, fix_gitlab_assets_permission, fix_list_style_inside_article, fix_list_style_on_folder_elements, fix_merge_request_url, fix_models_translations, fix_no_license, fix_software_api, fix_software_block_migration, fix_software_communities_translations, fix_software_communities_unit_test, fix_style_create_institution_admin_panel, fix_superarchives_imports, fix_sym_links_noosfero, header_fix, lxc_settings, margin_fix, mezuro_cookbook, refactor_download_block, remove-unused-images, remove_broken_theme, remove_secondary_email_from_user, remove_sisp_buttons, sisp_catalog_header, sisp_colab_config, sisp_dev, sisp_dev_master, sisp_simple_version, software_catalog_style_fix, software_communities_html_refactor, software_infos_api, spb_to_rails4, stable-4.1, stable-4.2, stable-4.x, theme_header, theme_javascript_refactory, thread_dropdown, update_search_by_categories, update_software_api
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>
(cherry picked from commit fe196cc352bb19b4b21429cf516c6335d3ddac5c)
| @@ -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 |