├── log └── .keep ├── tmp └── .keep ├── lib ├── assets │ └── .keep └── tasks │ └── .keep ├── public ├── favicon.ico ├── apple-touch-icon.png ├── apple-touch-icon-precomposed.png └── robots.txt ├── .ruby-version ├── app ├── assets │ ├── images │ │ └── .keep │ ├── javascripts │ │ ├── channels │ │ │ └── .keep │ │ └── cable.js │ ├── config │ │ └── manifest.js │ └── stylesheets │ │ └── decidim.scss ├── models │ ├── concerns │ │ └── .keep │ └── application_record.rb ├── controllers │ ├── concerns │ │ └── .keep │ ├── application_controller.rb │ └── decidim_controller.rb ├── helpers │ └── application_helper.rb ├── jobs │ └── application_job.rb ├── channels │ └── application_cable │ │ ├── channel.rb │ │ └── connection.rb ├── mailers │ └── application_mailer.rb └── views │ ├── layouts │ ├── decidim │ │ └── _head_extra.html.erb │ └── mailer.html.erb │ └── census_authorization │ └── _form.html.erb ├── .tool-versions ├── vendor └── assets │ ├── javascripts │ └── .keep │ └── stylesheets │ └── .keep ├── .rspec ├── spec └── factories.rb ├── update_decidim.sh ├── bin ├── decidim_update ├── bundle ├── rspec ├── rake ├── rails └── spring ├── config ├── spring.rb ├── boot.rb ├── environment.rb ├── initializers │ ├── session_store.rb │ ├── mime_types.rb │ ├── application_controller_renderer.rb │ ├── filter_parameter_logging.rb │ ├── cookies_serializer.rb │ ├── social_share_button.rb │ ├── backtrace_silencers.rb │ ├── assets.rb │ └── wrap_parameters.rb ├── cable.yml ├── sidekiq.yml ├── routes.rb └── puma.rb ├── config.ru ├── Procfile ├── reset_local_db.sh ├── Rakefile ├── db ├── migrate │ ├── 20170320140462_add_locale_to_users.decidim.rb │ ├── 20170320140479_add_avatar_to_users.decidim.rb │ ├── 20170320140460_add_name_to_users.decidim.rb │ ├── 20170320140496_add_timestamps_to_identities.decidim.rb │ ├── 20170320140456_user_has_roles.decidim.rb │ ├── 20170320140480_add_logo_to_organizations.decidim.rb │ ├── 20170320140492_add_avatar_to_user_groups.decidim.rb │ ├── 20170320140494_add_weight_to_features.decidim.rb │ ├── 20170320140520_remove_page_feature_titles.decidim_pages.rb │ ├── 20170320140482_add_handler_to_organization.decidim.rb │ ├── 20170602132111_add_rejected_at_to_user_groups.decidim.rb │ ├── 20170320140463_add_hero_image_to_processes.decidim.rb │ ├── 20170320140490_add_user_groups_verified.decidim.rb │ ├── 20170320140464_add_banner_image_to_processes.decidim.rb │ ├── 20170320140497_add_favicon_to_decidim_organizations.decidim.rb │ ├── 20201019083035_remove_newsletter_body.decidim.rb │ ├── 20170320140519_remove_commentable_flag_from_pages.decidim_pages.rb │ ├── 20180404082739_enable_pg_extensions.decidim_proposals.rb │ ├── 20170320140498_add_action_permissions_to_decidim_features.decidim.rb │ ├── 20170320140541_add_hidden_at_to_proposals.decidim_proposals.rb │ ├── 20170320140455_user_belongs_to_organization.decidim.rb │ ├── 20170320140470_add_published_at_to_processes.decidim.rb │ ├── 20170320140522_add_depth_to_comments.decidim_comments.rb │ ├── 20170915091132_add_extra_to_notifications.decidim.rb │ ├── 20201019083022_add_session_token_to_users.decidim.rb │ ├── 20201019083033_rename_scope_column.decidim.rb │ ├── 20170320140471_remove_not_null_on_step_position.decidim.rb │ ├── 20170320140518_add_commentable_to_pages.decidim_pages.rb │ ├── 20170427135830_remove_not_null_reference_results.decidim_results.rb │ ├── 20170427135831_remove_not_null_reference_budgets.decidim_budgets.rb │ ├── 20170829072058_add_roles_to_users.decidim.rb │ ├── 20190307141771_add_area_to_action_logs.decidim.rb │ ├── 20170320140458_add_description_to_organizations.decidim.rb │ ├── 20170320140478_make_organization_description_optional.decidim.rb │ ├── 20170320140481_add_configuration_to_features.decidim.rb │ ├── 20170320140489_add_show_statistics_to_organization.decidim.rb │ ├── 20170320140545_remove_short_description_from_results.decidim_results.rb │ ├── 20170405124720_add_organization_to_identities.decidim.rb │ ├── 20170427135828_remove_not_null_reference_meetings.decidim_meetings.rb │ ├── 20190307141770_add_scope_to_action_logs.decidim.rb │ ├── 20210412081141_add_locale_to_moderation_reports.decidim.rb │ ├── 20170320140465_add_promoted_flag_to_processes.decidim.rb │ ├── 20170320140523_add_alignment_to_comments.decidim_comments.rb │ ├── 20170320140529_remove_short_description_from_meetings.decidim_meetings.rb │ ├── 20170320140539_add_report_count_to_proposals.decidim_proposals.rb │ ├── 20170427135829_remove_not_null_reference_proposals.decidim_proposals.rb │ ├── 20170829072055_add_managed_to_users.decidim.rb │ ├── 20170320140525_add_user_group_id_to_comments.decidim_comments.rb │ ├── 20181120111025_add_images_to_content_blocks.decidim.rb │ ├── 20190307141784_use_big_ints_for_budgets.decidim_budgets.rb │ ├── 20201019083064_remove_survey_answers.decidim_surveys.rb │ ├── 20170320140500_add_newsletter_notifications_to_users.decidim.rb │ ├── 20170320140535_add_user_group_id_to_proposals.decidim_proposals.rb │ ├── 20170320140550_remove_short_description_from_decidim_projects.decidim_budgets.rb │ ├── 20180209123431_add_author_to_debates.decidim_debates.rb │ ├── 20180404082741_drop_category_id_column.decidim_debates.rb │ ├── 20190311102113_add_missing_counters_to_users.rb │ ├── 20200221134115_add_weight_to_categories.decidim.rb │ ├── 20201019083032_add_id_to_content_blocks_scope.decidim.rb │ ├── 20201019083065_remove_survey_questions.decidim_surveys.rb │ ├── 20210412081140_add_reported_content_to_moderations.decidim.rb │ ├── 20170320140510_add_secondary_hosts_to_organizations.decidim.rb │ ├── 20170829072059_attachment_description_nullable.decidim.rb │ ├── 20170915091134_add_header_snippets_to_organizations.decidim.rb │ ├── 20180404082735_add_reference_to_assemblies.decidim_assemblies.rb │ ├── 20180404082736_add_area_to_assemblies.decidim_assemblies.rb │ ├── 20180514135732_add_title_to_sortition.decidim_sortitions.rb │ ├── 20181120111049_add_position_to_proposals.decidim_proposals.rb │ ├── 20190613081740_add_colors_to_decidim_organization.decidim.rb │ ├── 20190705112621_add_extended_data_to_newsletters.decidim.rb │ ├── 20201019083026_index_foreign_keys_in_decidim_amendments.decidim.rb │ ├── 20201019083027_index_foreign_keys_in_decidim_authorizations.decidim.rb │ ├── 20201019083031_index_foreign_keys_in_oauth_access_grants.decidim.rb │ ├── 20210412081158_add_online_meeting_url.decidim_meetings.rb │ ├── 20170320140486_add_uniqueness_field_to_authorizations.decidim.rb │ ├── 20180514135712_add_services_to_meetings.decidim_meetings.rb │ ├── 20180615103566_add_organizer_to_meetings.decidim_meetings.rb │ ├── 20181120111023_rename_content_block_options_to_settings.decidim.rb │ ├── 20201019083023_add_organization_timezone.decidim.rb │ ├── 20201019083070_add_user_group_author_to_blogs.decidim_blogs.rb │ ├── 20210412081134_remove_show_statistics_from_organizations.decidim.rb │ ├── 20210412081139_add_current_suspension_id_to_decidim_users.decidim.rb │ ├── 20180209123430_add_debate_information_updates.decidim_debates.rb │ ├── 20190705112620_add_smtp_settings_to_decidim_organizations.decidim.rb │ ├── 20201019083029_index_foreign_keys_in_decidim_endorsements.decidim.rb │ ├── 20201019083030_index_foreign_keys_in_decidim_notifications.decidim.rb │ ├── 20201019083062_remove_survey_answer_choices.decidim_surveys.rb │ ├── 20201019083063_remove_survey_answer_options.decidim_surveys.rb │ ├── 20210114102033_rename_budget_to_budget_ammount.decidim_budgets.rb │ ├── 20210114102038_add_selected_at_to_project.decidim_budgets.rb │ ├── 20210412081146_add_email_on_moderations_to_users.decidim.rb │ ├── 20180209123428_add_index_created_at_proposal_notes.decidim_proposals.rb │ ├── 20180514135704_add_reason_to_decidim_impersonation_logs.decidim_admin.rb │ ├── 20180514135706_add_private_to_assemblies.decidim_assemblies.rb │ ├── 20180514135728_add_witnesses_to_sortitions.decidim_sortitions.rb │ ├── 20180615103571_add_weight_to_results.decidim_accountability.rb │ ├── 20201019083072_index_foreign_keys_in_decidim_blogs_posts.decidim_blogs.rb │ ├── 20210114102037_add_scope_to_budgets.decidim_budgets.rb │ ├── 20210412081159_add_type_of_meeting.decidim_meetings.rb │ ├── 20170320140534_add_counter_cache_votes_to_proposals.decidim_proposals.rb │ ├── 20170616093820_add_mandatory_to_surveys_questions.decidim_surveys.rb │ ├── 20170829072060_add_announcement_to_participatory_processes.decidim.rb │ ├── 20180209123417_extend_user_profile.decidim.rb │ ├── 20180209123433_add_user_group_author_to_debates.decidim_debates.rb │ ├── 20180514135730_add_author_to_sortitions.decidim_sortitions.rb │ ├── 20180514135737_rename_sortitions_table.decidim_sortitions.rb │ ├── 20180514135741_add_author_to_decidim_blogs_posts.decidim_blogs.rb │ ├── 20190307141782_add_created_in_meeting.decidim_proposals.rb │ ├── 20201019083018_add_omniauth_settings_to_decidim_organization.decidim.rb │ ├── 20201019083047_index_foreign_keys_in_decidim_assemblies.decidim_assemblies.rb │ ├── 20170320140508_add_scopes_to_processes.decidim.rb │ ├── 20170915091135_remove_followable_index_from_follows.decidim.rb │ ├── 20180514135717_add_max_choices_to_survey_questions.decidim_surveys.rb │ ├── 20201019083037_add_accepted_admin_terms_at_field_to_users.decidim_admin.rb │ ├── 20210114102035_add_budget_reference_to_order.decidim_budgets.rb │ ├── 20210412081156_add_weight_field_to_assembly.decidim_assemblies.rb │ ├── 20210412081167_add_scope_to_debates_debate.decidim_debates.rb │ ├── 20170405124719_change_decidim_user_email_index_uniqueness.decidim.rb │ ├── 20170616093819_add_position_to_surveys_questions.decidim_surveys.rb │ ├── 20170616093821_add_question_type_to_surveys_questions.decidim_surveys.rb │ ├── 20180514135722_add_free_text_to_survey_answer_options.decidim_surveys.rb │ ├── 20180514135729_add_additional_info_to_sortitions.decidim_sortitions.rb │ ├── 20180615103572_add_external_id_to_results.decidim_accountability.rb │ ├── 20201019083028_index_foreign_keys_in_decidim_contextual_help_sections.decidim.rb │ ├── 20201019083058_add_state_published_at_to_proposals.decidim_proposals.rb │ ├── 20201019083068_index_foreign_keys_in_decidim_debates_debates.decidim_debates.rb │ ├── 20210114102034_add_budget_reference_to_project.decidim_budgets.rb │ ├── 20170915091133_add_emails_on_notifications_flag_to_user.decidim.rb │ ├── 20180209123421_add_omnipresent_banner_url_to_decidim_organizations.decidim.rb │ ├── 20180404082734_add_reference_to_processes.decidim_participatory_processes.rb │ ├── 20180514135711_add_fields_for_registrations.decidim_meetings.rb │ ├── 20180514135718_add_description_to_decidim_survey_questions.decidim_surveys.rb │ ├── 20180514135723_add_custom_body_to_survey_answer_choices.decidim_surveys.rb │ ├── 20180514135735_make_sortition_reference_nullable.decidim_sortitions.rb │ ├── 20170616093807_add_deleted_fields_to_users.decidim.rb │ ├── 20180209123419_add_omnipresent_banner_title_to_decidim_organizations.decidim.rb │ ├── 20180209123425_add_scopes_enabled_to_assemblies.decidim_assemblies.rb │ ├── 20181120111040_add_code_to_decidim_meetings_registrations.decidim_meetings.rb │ ├── 20190705112625_add_user_group_to_meetings_registrations.decidim_meetings.rb │ ├── 20201019083051_index_foreign_keys_in_decidim_comments_comments.decidim_comments.rb │ ├── 20210114102014_add_comments_max_length_to_decidim_organization.decidim.rb │ ├── 20170320140528_add_latitude_and_longitude_to_meetings.decidim_meetings.rb │ ├── 20170616093822_add_answer_options_to_surveys_questions.decidim_surveys.rb │ ├── 20170803094941_add_show_statistics_to_participatory_processes.decidim.rb │ ├── 20180404082732_add_weight_to_attachments.decidim_participatory_processes.rb │ ├── 20180514135724_add_position_to_decidim_survey_answer_choices.decidim_surveys.rb │ ├── 20180514135736_add_candidate_proposals_to_sortitions.decidim_sortitions.rb │ ├── 20181120111048_add_participatory_text_level_to_proposals.decidim_proposals.rb │ ├── 20201019083048_index_foreign_keys_in_decidim_assembly_user_roles.decidim_assemblies.rb │ ├── 20201019083071_add_endorsements_counter_cache_to_blogs.decidim_blogs.rb │ ├── 20210412081148_add_max_characters_to_decidim_forms_questions.decidim_forms.rb │ ├── 20210412081168_archive_debates.decidim_debates.rb │ ├── 20170320140485_loosen_step_requirements.decidim.rb │ ├── 20190307141764_add_users_registration_mode_to_organizations.decidim.rb │ ├── 20170427135827_change_steps_end_and_start_date_to_date.decidim.rb │ ├── 20170829072061_add_scopes_enabled_to_participatory_processes.decidim.rb │ ├── 20171031144632_add_children_counter_cache_to_results.decidim_accountability.rb │ ├── 20181120111041_add_validated_at_to_decidim_meetings_registrations.decidim_meetings.rb │ ├── 20201019083042_index_foreign_keys_in_decidim_attachments.decidim_participatory_processes.rb │ ├── 20201019083052_index_foreign_keys_in_decidim_meetings_registrations.decidim_meetings.rb │ ├── 20201019083067_index_foreign_keys_in_decidim_accountability_results.decidim_accountability.rb │ ├── 20201019083069_index_foreign_keys_in_decidim_sortitions_sortitions.decidim_sortitions.rb │ ├── 20210412081169_revert_archive_debates.decidim_debates.rb │ ├── 20170721075616_add_admin_to_users.decidim.rb │ ├── 20190705112624_add_area_to_participatory_processes.decidim_participatory_processes.rb │ ├── 20170320140474_create_decidim_features.decidim.rb │ ├── 20181120111027_add_visibility_to_action_logs.decidim.rb │ ├── 20181120111051_add_temporary_votes.decidim_proposals.rb │ ├── 20210114102012_add_enable_machine_translation_to_decidim_organizations.decidim.rb │ ├── 20210114102017_remove_notifications_with_continuity_badge.decidim.rb │ ├── 20170320140502_add_published_at_to_decidim_features.decidim.rb │ ├── 20171212150150_add_verification_attachment_to_authorizations.decidim.rb │ ├── 20201019083053_add_endorsements_counter_cache_to_proposals.decidim_proposals.rb │ ├── 20210412081150_add_hashtag_to_participatory_process_groups.decidim_participatory_processes.rb │ ├── 20170320140546_add_reference_to_results.decidim_results.rb │ ├── 20170721075618_rename_participatory_process_user_roles_table.decidim_admin.rb │ ├── 20171212150148_add_status_to_authorizations.decidim.rb │ ├── 20180209123418_add_enable_omnipresent_banner_to_decidim_organizations.decidim.rb │ ├── 20180209123420_add_omnipresent_banner_short_description_to_decidim_organizations.decidim.rb │ ├── 20190307141780_add_registration_form_enabled_to_decidim_meetings.decidim_meetings.rb │ ├── 20170320140517_create_decidim_pages.decidim_pages.rb │ ├── 20170320140551_add_reference_to_projects.decidim_budgets.rb │ ├── 20180514135705_add_private_to_participatory_processes.decidim_participatory_processes.rb │ ├── 20180615103563_assembly_member_belongs_to_user.decidim_assemblies.rb │ ├── 20210218074155_add_salt_to_decidim_meetings.decidim_meetings.rb │ ├── 20170320140530_add_reference_to_meetings.decidim_meetings.rb │ ├── 20180615103564_update_assembly_members_index.decidim_assemblies.rb │ ├── 20201019083020_add_admin_terms_of_use_body_field_to_organization.decidim.rb │ ├── 20201019083041_add_show_metrics_to_participatory_processes.decidim_participatory_processes.rb │ ├── 20170320140473_add_index_for_process_slug_organization.decidim.rb │ ├── 20170320140477_create_decidim_scopes.decidim.rb │ ├── 20170320140487_create_user_groups.decidim.rb │ ├── 20171031144626_add_cta_button_url_and_text_to_organization.decidim.rb │ ├── 20210412081137_add_suspension_fields_to_decidim_users.decidim.rb │ ├── 20170320140504_add_organization_logo_and_url.decidim.rb │ ├── 20170320140533_add_text_search_indexes.decidim_proposals.rb │ ├── 20170320140540_add_reference_to_proposals.decidim_proposals.rb │ ├── 20170915091136_remove_comment_and_replies_notifications_from_users.decidim.rb │ ├── 20210412081154_add_weight_field_to_participatory_processes.decidim_participatory_processes.rb │ ├── 20170522083322_add_root_commentable_to_comments.decidim_comments.rb │ ├── 20170522083324_set_root_commentable_null_constraints.decidim_comments.rb │ ├── 20180615103565_add_meeting_types.decidim_meetings.rb │ ├── 20201019083040_add_scope_type_to_participatory_processes.decidim_participatory_processes.rb │ ├── 20201019083049_remove_legacy_decidim_assembly_type.decidim_assemblies.rb │ ├── 20210412081144_update_table_block_user_functionality.decidim.rb │ ├── 20181120111045_add_counter_cache_coauthorships_to_collaborative_drafts.decidim_proposals.rb │ ├── 20201119110444_create_decidim_term_customizer_translation_sets.decidim_term_customizer.rb │ ├── 20210114102042_close_debates.decidim_debates.rb │ ├── 20170320140499_add_comments_and_replies_notifications_to_users.decidim.rb │ ├── 20180514135731_add_reference_to_sortitions.decidim_sortitions.rb │ ├── 20181120111029_add_badge_switch_to_organizations.decidim.rb │ ├── 20181120111046_remove_index_counter_cache_coauthorships_to_proposals.decidim_proposals.rb │ ├── 20170320140476_add_categories.decidim.rb │ ├── 20210315083951_invalidate_all_sessions_for_deleted_users.decidim.rb │ ├── 20170320140536_add_answers_to_proposals.decidim_proposals.rb │ ├── 20170320140542_add_geolocalization_fields_to_proposals.decidim_proposals.rb │ ├── 20180209123423_add_officialization_to_users.decidim_admin.rb │ ├── 20181120111024_add_badge_scores.decidim.rb │ ├── 20190307141779_reset_negative_children_count_counters.decidim_assemblies.rb │ ├── 20201019083025_index_foreign_keys_in_decidim_action_logs.decidim.rb │ ├── 20210114102027_drop_proposal_endorsements.decidim_proposals.rb │ ├── 20171031144629_add_description_and_progress_to_statuses.decidim_accountability.rb │ ├── 20180716091761_remove_authorships_from_proposals.decidim_proposals.rb │ ├── 20210412081153_add_promoted_flag_to_decidim_participatory_process_groups.decidim_participatory_processes.rb │ ├── 20170616093817_create_decidim_survey_questions.decidim_surveys.rb │ ├── 20180514135740_create_decidim_blogs_posts.decidim_blogs.rb │ ├── 20190307141773_add_user_groups_switch_to_organizations.decidim.rb │ ├── 20201019083019_add_rich_text_editor_in_public_views_to_organizations.decidim.rb │ ├── 20180404082726_create_decidim_area_types.decidim.rb │ ├── 20181120111035_add_cta_url_and_text_to_steps.decidim_participatory_processes.rb │ ├── 20190307141767_add_columns_to_static_page_topic.decidim.rb │ ├── 20170320140537_add_index_to_decidim_proposals_proposals_proposal_votes_count.decidim_proposals.rb │ ├── 20171212150149_add_verification_metadata_to_authorizations.decidim.rb │ ├── 20180209123432_add_reference_to_debates.decidim_debates.rb │ ├── 20201019083056_add_costs_to_proposals.decidim_proposals.rb │ ├── 20210412081135_create_decidim_user_moderations.decidim.rb │ ├── 20170320140484_create_identities.decidim.rb │ ├── 20201019083043_index_foreign_keys_in_decidim_participatory_process_user_roles.decidim_participatory_processes.rb │ ├── 20170320140468_add_active_flag_to_step.decidim.rb │ ├── 20180404082725_fix_reference_for_all_resources.decidim.rb │ ├── 20180615103568_create_decidim_agendas.decidim_meetings.rb │ ├── 20170915091138_add_start_date_to_processes.decidim_participatory_processes.rb │ ├── 20171212150154_create_decidim_receipts.decidim.rb │ ├── 20180514135738_fix_sortitions_feature.decidim_sortitions.rb │ ├── 20190307141765_create_decidim_contextual_help_sections.decidim.rb │ ├── 20201019083050_create_decidim_assemblies_settings.decidim_assemblies.rb │ ├── 20210114102044_add_endorsable_to_debates.decidim_debates.rb │ ├── 20210412081145_rename_decidim_user_fields_for_block_functionality.decidim.rb │ ├── 20170320140483_create_resource_links.decidim.rb │ ├── 20200221134116_remove_continuity_badges.decidim.rb │ ├── 20170320140472_create_decidim_static_pages.decidim.rb │ ├── 20171031144627_create_accountability_statuses.decidim_accountability.rb │ ├── 20181120111019_fix_result_follows.decidim.rb │ ├── 20191028080429_add_force_users_to_authenticate_before_access_organization.decidim.rb │ ├── 20191028080430_add_confidential_to_doorkeeper_application.decidim.rb │ ├── 20200221134118_add_ip_hash_to_decidim_form_answers.decidim_forms.rb │ ├── 20201019083036_add_index_on_content_block_scope_id.decidim.rb │ ├── 20210114102023_create_meeting_services_table.decidim_meetings.rb │ ├── 20181120111021_create_decidim_hashtags.decidim.rb │ ├── 20170320140495_add_extra_info_to_processes.decidim.rb │ ├── 20210114102048_add_commentable_counter_cache_to_posts.decidim_blogs.rb │ ├── 20170320140503_add_social_media_handlers_to_organization.decidim.rb │ ├── 20180404082727_create_decidim_areas.decidim.rb │ ├── 20190307141777_create_decidim_forms_answer_options.decidim_forms.rb │ ├── 20201019083039_add_matrix_row_id_to_decidim_forms_answer_choices.decidim_forms.rb │ ├── 20170616093816_create_decidim_surveys.decidim_surveys.rb │ ├── 20210114102025_add_commentable_counter_cache_to_meetings.decidim_meetings.rb │ ├── 20210114102040_add_commentable_counter_cache_to_projects.decidim_budgets.rb │ ├── 20170320140506_add_organization_custom_reference.decidim.rb │ ├── 20170616093808_set_email_unique_in_organization_conditional.decidim.rb │ ├── 20180615103567_create_meetings_minutes.decidim_meetings.rb │ ├── 20210114102021_add_commentable_counter_cache_to_comments.decidim_comments.rb │ ├── 20180514135734_add_cancel_data_to_sortition.decidim_sortitions.rb │ ├── 20181120111052_add_organization_as_author.decidim_proposals.rb │ ├── 20170320140513_add_available_authorizations_to_organization.decidim.rb │ ├── 20170320140549_create_line_items.decidim_budgets.rb │ ├── 20180514135739_fix_sortitions_proposal_feature.decidim_sortitions.rb │ ├── 20170320140467_create_decidim_authorizations.decidim.rb │ ├── 20170829072057_create_impersonation_logs.decidim.rb │ ├── 20180716091759_add_counter_cache_coauthorships_to_proposals.decidim_proposals.rb │ ├── 20201019083038_create_decidim_forms_question_matrix_rows.decidim_forms.rb │ ├── 20170320140544_create_results.decidim_results.rb │ ├── 20181120111016_create_decidim_resource_permissions.decidim.rb │ ├── 20210114102047_add_commentable_counter_cache_to_sortitions.decidim_sortitions.rb │ ├── 20180404082738_add_counter_cache_endorsements_to_proposals.decidim_proposals.rb │ ├── 20181120111018_add_nickname_to_managed_users.decidim.rb │ ├── 20181120111047_create_participatory_texts.decidim_proposals.rb │ ├── 20190613081741_create_decidim_verifications_csv_data.decidim_verifications.rb │ ├── 20210114102041_add_commentable_counter_cache_to_results.decidim_accountability.rb │ ├── 20190307141761_add_static_page_topics.decidim.rb │ ├── 20170320140516_change_user_groups_verified_to_timestamp.decidim_admin.rb │ ├── 20170616093811_create_decidim_categorizations.decidim.rb │ ├── 20170915091131_create_decidim_notifications.decidim.rb │ ├── 20210114102032_create_decidim_budgets.decidim_budgets.rb │ ├── 20170320140469_add_position_to_steps.decidim.rb │ ├── 20170320140505_create_decidim_newsletters.decidim.rb │ ├── 20170915091139_add_registration_attributes_to_meetings.decidim_meetings.rb │ ├── 20210412081138_create_decidim_user_suspensions.decidim.rb │ ├── 20201019083044_index_foreign_keys_in_decidim_participatory_processes.decidim_participatory_processes.rb │ ├── 20170320140527_close_a_meeting.decidim_meetings.rb │ ├── 20170320140548_create_orders.decidim_budgets.rb │ ├── 20180615103569_create_decidim_agenda_items.decidim_meetings.rb │ ├── 20181120111030_create_decidim_continuity_badge_statuses.decidim.rb │ ├── 20190307141772_add_notification_types_to_users.decidim.rb │ ├── 20200221134114_add_lockable_to_users.decidim.rb │ ├── 20170320140547_create_projects.decidim_budgets.rb │ ├── 20180514135733_drop_decidim_category_id_from_sortitions.decidim_sortitions.rb │ ├── 20190307141763_add_welcome_notification.decidim.rb │ ├── 20190307141766_add_following_and_followers_counters_to_users.decidim.rb │ ├── 20181120111039_create_decidim_meetings_invites.decidim_meetings.rb │ ├── 20201019083024_add_direct_message_types_to_users.decidim.rb │ ├── 20201019083059_publish_existing_proposals_state.decidim_proposals.rb │ ├── 20170320140531_create_decidim_proposals.decidim_proposals.rb │ ├── 20170616093818_create_decidim_survey_answers.decidim_surveys.rb │ ├── 20171031144630_create_accountability_timeline_entries.decidim_accountability.rb │ ├── 20190307141775_create_decidim_forms_questions.decidim_forms.rb │ ├── 20170320140488_create_user_group_memberships.decidim.rb │ ├── 20180209123429_create_debates.decidim_debates.rb │ ├── 20180404082723_create_decidim_attachment_collections.decidim.rb │ ├── 20190307141774_create_decidim_forms_questionnaires.decidim_forms.rb │ ├── 20190307141776_create_decidim_forms_answers.decidim_forms.rb │ ├── 20190307141781_add_questionnaire_to_existing_meetings.decidim_meetings.rb │ ├── 20210218074154_add_salt_to_decidim_forms_questionnaires.decidim_forms.rb │ ├── 20180514135709_rename_features_to_components_at_pages.decidim_pages.rb │ ├── 20170320140521_create_comments.decidim_comments.rb │ ├── 20180404082740_add_published_at_to_proposals.decidim_proposals.rb │ ├── 20180716091757_create_coauthorships.decidim.rb │ ├── 20190307141762_add_timestamps_to_components.decidim.rb │ ├── 20170829072056_set_email_unique_in_organization_condition_for_managed_users.decidim.rb │ ├── 20170915091140_create_registrations.decidim_meetings.rb │ ├── 20171212150153_add_object_changes_to_versions.decidim.rb │ ├── 20190307141778_create_decidim_forms_answer_choices.decidim_forms.rb │ ├── 20210412081147_add_followable_counter_cache_to_users.decidim.rb │ ├── 20210412081162_fix_answered_proposals_after_copy.decidim_proposals.rb │ ├── 20170405124721_change_decidim_identities_provider_uid_index_uniqueness.decidim.rb │ ├── 20201019083055_add_proposal_valuation_assignments.decidim_proposals.rb │ ├── 20210412081171_add_followable_counter_cache_to_blogs.decidim_blogs.rb │ ├── 20170320140509_add_participatory_process_groups.decidim.rb │ ├── 20180514135716_rename_features_to_components_at_surveys.decidim_surveys.rb │ ├── 20180514135726_rename_features_to_components_at_debates.decidim_debates.rb │ ├── 20210412081157_add_followable_counter_cache_to_assemblies.decidim_assemblies.rb │ ├── 20181120111054_fix_user_groups_ids_on_debates.decidim_debates.rb │ ├── 20180209123426_add_assembly_user_roles.decidim_assemblies.rb │ ├── 20181120111036_fix_user_groups_ids_in_comments.decidim_comments.rb │ ├── 20210412081136_create_decidim_user_reports.decidim.rb │ ├── 20210412081166_add_followable_counter_cache_to_budgets.decidim_budgets.rb │ ├── 20210412081170_add_followable_counter_cache_to_debates.decidim_debates.rb │ ├── 20170320140511_create_reports.decidim.rb │ ├── 20171212150152_create_versions.decidim.rb │ ├── 20180514135710_rename_features_to_components_at_meetings.decidim_meetings.rb │ └── 20190705112622_add_missing_indexes.decidim.rb └── seeds.rb ├── .github └── PULL_REQUEST_TEMPLATE.md ├── README.md ├── docker-compose.yml └── .gitignore /log/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tmp/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/tasks/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.ruby-version: -------------------------------------------------------------------------------- 1 | 2.7.3 2 | -------------------------------------------------------------------------------- /app/assets/images/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/models/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/apple-touch-icon.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.tool-versions: -------------------------------------------------------------------------------- 1 | ruby 2.7.3 2 | -------------------------------------------------------------------------------- /app/controllers/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/assets/stylesheets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/javascripts/channels/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --color 2 | --require spec_helper 3 | -------------------------------------------------------------------------------- /app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | end 3 | -------------------------------------------------------------------------------- /spec/factories.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | require "decidim/core/test/factories" 3 | -------------------------------------------------------------------------------- /update_decidim.sh: -------------------------------------------------------------------------------- 1 | bundle update decidim decidim-dev && rake decidim:upgrade && rake db:migrate 2 | -------------------------------------------------------------------------------- /app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | self.abstract_class = true 3 | end 4 | -------------------------------------------------------------------------------- /bin/decidim_update: -------------------------------------------------------------------------------- 1 | bundle update decidim decidim-dev decidim-term_customizer && bundle exec rake decidim:upgrade db:migrate 2 | -------------------------------------------------------------------------------- /app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Channel < ActionCable::Channel::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_directory ../javascripts .js 3 | //= link_directory ../stylesheets .css 4 | -------------------------------------------------------------------------------- /app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Connection < ActionCable::Connection::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | protect_from_forgery with: :exception 3 | end 4 | -------------------------------------------------------------------------------- /app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: 'from@example.com' 3 | layout 'mailer' 4 | end 5 | -------------------------------------------------------------------------------- /bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /config/spring.rb: -------------------------------------------------------------------------------- 1 | %w( 2 | .ruby-version 3 | .rbenv-vars 4 | tmp/restart.txt 5 | tmp/caching-dev.txt 6 | ).each { |path| Spring.watch(path) } 7 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 2 | 3 | require 'bundler/setup' # Set up gems listed in the Gemfile. 4 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative 'config/environment' 4 | 5 | run Rails.application 6 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative 'application' 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: jemalloc.sh bundle exec puma -C config/puma.rb 2 | worker: bundle exec sidekiq -e ${RACK_ENV:-development} -C config/sidekiq.yml 3 | release: bundle exec rake db:migrate 4 | -------------------------------------------------------------------------------- /app/views/layouts/decidim/_head_extra.html.erb: -------------------------------------------------------------------------------- 1 | <% if I18n.locale != :en %> 2 | <%= javascript_include_tag "datepicker-locales/foundation-datepicker.#{I18n.locale}.js" %> 3 | <% end %> 4 | -------------------------------------------------------------------------------- /config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.session_store :cookie_store, key: '_decidim_terrassa_session' 4 | -------------------------------------------------------------------------------- /config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: async 6 | 7 | production: 8 | adapter: redis 9 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> 10 | -------------------------------------------------------------------------------- /config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # ApplicationController.renderer.defaults.merge!( 4 | # http_host: 'example.org', 5 | # https: false 6 | # ) 7 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /bin/rspec: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | require 'bundler/setup' 8 | load Gem.bin_path('rspec-core', 'rspec') 9 | -------------------------------------------------------------------------------- /config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /reset_local_db.sh: -------------------------------------------------------------------------------- 1 | rails runner "Decidim::Organization.first.update(host: 'localhost'); admin = Decidim::User.where(admin: true).first; admin.update(email: 'admin@example.org', password: 'decidim123456', password_confirmation: 'decidim123456'); admin.confirm;" -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative 'config/application' 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | require_relative '../config/boot' 8 | require 'rake' 9 | Rake.application.run 10 | -------------------------------------------------------------------------------- /db/migrate/20170320140462_add_locale_to_users.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20161010131544) 2 | class AddLocaleToUsers < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_users, :locale, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170320140479_add_avatar_to_users.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20161213094244) 2 | class AddAvatarToUsers < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_users, :avatar, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170320140460_add_name_to_users.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20161010085443) 2 | class AddNameToUsers < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_users, :name, :string, null: false 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170320140496_add_timestamps_to_identities.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170128140553) 2 | class AddTimestampsToIdentities < ActiveRecord::Migration[5.0] 3 | def change 4 | add_timestamps :decidim_identities 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170320140456_user_has_roles.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20160920141151) 2 | class UserHasRoles < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_users, :roles, :string, array: true, default: [] 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170320140480_add_logo_to_organizations.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20161214152811) 2 | class AddLogoToOrganizations < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_organizations, :logo, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170320140492_add_avatar_to_user_groups.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170123140857) 2 | class AddAvatarToUserGroups < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_user_groups, :avatar, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170320140494_add_weight_to_features.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170125152026) 2 | class AddWeightToFeatures < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_features, :weight, :integer, default: 0 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170320140520_remove_page_feature_titles.decidim_pages.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_pages (originally 20170220091402) 2 | class RemovePageFeatureTitles < ActiveRecord::Migration[5.0] 3 | def change 4 | remove_column :decidim_pages_pages, :title 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170320140482_add_handler_to_organization.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170110153807) 2 | class AddHandlerToOrganization < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_organizations, :twitter_handler, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170602132111_add_rejected_at_to_user_groups.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170529150743) 2 | class AddRejectedAtToUserGroups < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_user_groups, :rejected_at, :datetime 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Specify a serializer for the signed and encrypted cookie jars. 4 | # Valid options are :json, :marshal, and :hybrid. 5 | Rails.application.config.action_dispatch.cookies_serializer = :json 6 | -------------------------------------------------------------------------------- /db/migrate/20170320140463_add_hero_image_to_processes.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20161011125616) 2 | class AddHeroImageToProcesses < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_participatory_processes, :hero_image, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170320140490_add_user_groups_verified.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170120120733) 2 | class AddUserGroupsVerified < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_user_groups, :verified, :boolean, default: false 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170320140464_add_banner_image_to_processes.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20161011141033) 2 | class AddBannerImageToProcesses < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_participatory_processes, :banner_image, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170320140497_add_favicon_to_decidim_organizations.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170130132833) 2 | class AddFaviconToDecidimOrganizations < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_organizations, :favicon, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20201019083035_remove_newsletter_body.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20200327082954) 3 | 4 | class RemoveNewsletterBody < ActiveRecord::Migration[5.2] 5 | def change 6 | remove_column :decidim_newsletters, :body 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170320140519_remove_commentable_flag_from_pages.decidim_pages.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_pages (originally 20170110145040) 2 | class RemoveCommentableFlagFromPages < ActiveRecord::Migration[5.0] 3 | def change 4 | remove_column :decidim_pages_pages, :commentable 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180404082739_enable_pg_extensions.decidim_proposals.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_proposals (originally 20171212102250) 2 | # frozen_string_literal: true 3 | 4 | class EnablePgExtensions < ActiveRecord::Migration[5.1] 5 | def change 6 | enable_extension "pg_trgm" 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | APP_PATH = File.expand_path('../config/application', __dir__) 8 | require_relative '../config/boot' 9 | require 'rails/commands' 10 | -------------------------------------------------------------------------------- /config/sidekiq.yml: -------------------------------------------------------------------------------- 1 | :concurrency: 5 2 | :queues: 3 | - [mailers, 4] 4 | - [default, 2] 5 | - [newsletter, 2] 6 | - [newsletters_opt_in, 2] 7 | - [conference_diplomas, 2] 8 | - [decidim_events, 2] 9 | - [events, 2] 10 | - [user_report, 2] 11 | - [block_user, 2] 12 | - [metrics, 1] 13 | 14 | -------------------------------------------------------------------------------- /db/migrate/20170320140498_add_action_permissions_to_decidim_features.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170131134349) 2 | class AddActionPermissionsToDecidimFeatures < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_features, :permissions, :jsonb 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170320140541_add_hidden_at_to_proposals.decidim_proposals.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_proposals (originally 20170220152416) 2 | class AddHiddenAtToProposals < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_proposals_proposals, :hidden_at, :datetime 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /db/migrate/20170320140455_user_belongs_to_organization.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20160920141039) 2 | class UserBelongsToOrganization < ActiveRecord::Migration[5.0] 3 | def change 4 | add_reference :decidim_users, :decidim_organization, index: true, foreign_key: true 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170320140470_add_published_at_to_processes.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20161025125300) 2 | class AddPublishedAtToProcesses < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_participatory_processes, :published_at, :datetime, index: true 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170320140522_add_depth_to_comments.decidim_comments.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_comments (originally 20161214082645) 2 | class AddDepthToComments < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_comments_comments, :depth, :integer, null: false, default: 0 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170915091132_add_extra_to_notifications.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170906091718) 2 | # frozen_string_literal: true 3 | 4 | class AddExtraToNotifications < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_notifications, :extra, :jsonb 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20201019083022_add_session_token_to_users.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20191204075509) 3 | 4 | class AddSessionTokenToUsers < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_users, :session_token, :string 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20201019083033_rename_scope_column.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20200326102407) 3 | 4 | class RenameScopeColumn < ActiveRecord::Migration[5.2] 5 | def change 6 | rename_column :decidim_content_blocks, :scope, :scope_name 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170320140471_remove_not_null_on_step_position.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20161107152228) 2 | class RemoveNotNullOnStepPosition < ActiveRecord::Migration[5.0] 3 | def change 4 | change_column :decidim_participatory_process_steps, :position, :integer, null: true 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170320140518_add_commentable_to_pages.decidim_pages.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_pages (originally 20161214150429) 2 | class AddCommentableToPages < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_pages_pages, :commentable, :boolean, null: false, default: false 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170427135830_remove_not_null_reference_results.decidim_results.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_results (originally 20170410074358) 2 | class RemoveNotNullReferenceResults < ActiveRecord::Migration[5.0] 3 | def change 4 | change_column_null :decidim_results_results, :reference, true 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170427135831_remove_not_null_reference_budgets.decidim_budgets.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_budgets (originally 20170410074214) 2 | class RemoveNotNullReferenceBudgets < ActiveRecord::Migration[5.0] 3 | def change 4 | change_column_null :decidim_budgets_projects, :reference, true 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170829072058_add_roles_to_users.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170727125445) 2 | # frozen_string_literal: true 3 | 4 | class AddRolesToUsers < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_users, :roles, :string, array: true, default: [] 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20190307141771_add_area_to_action_logs.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20181211090933) 3 | 4 | class AddAreaToActionLogs < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_action_logs, :decidim_area_id, :integer 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | #### :tophat: What? Why? 2 | 3 | 4 | #### :pushpin: Related Issues 5 | - Related to #? 6 | - Fixes #? 7 | 8 | #### :clipboard: Subtasks 9 | - [x] Subtask 1 10 | - [ ] Subtask 2 11 | 12 | ### :camera: Screenshots (optional) 13 | ![Description](URL) 14 | 15 | #### :ghost: GIF 16 | ![]() 17 | -------------------------------------------------------------------------------- /db/migrate/20170320140458_add_description_to_organizations.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20161005153007) 2 | class AddDescriptionToOrganizations < ActiveRecord::Migration[5.0] 3 | def change 4 | change_table :decidim_organizations do |t| 5 | t.jsonb :description 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170320140478_make_organization_description_optional.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20161209134715) 2 | class MakeOrganizationDescriptionOptional < ActiveRecord::Migration[5.0] 3 | def change 4 | change_column :decidim_organizations, :welcome_text, :jsonb, null: true 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170320140481_add_configuration_to_features.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170110133113) 2 | class AddConfigurationToFeatures < ActiveRecord::Migration[5.0] 3 | def change 4 | change_table :decidim_features do |t| 5 | t.jsonb :settings, default: {} 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170320140489_add_show_statistics_to_organization.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170119150649) 2 | class AddShowStatisticsToOrganization < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_organizations, :show_statistics, :boolean, default: true 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170320140545_remove_short_description_from_results.decidim_results.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_results (originally 20170129164553) 2 | class RemoveShortDescriptionFromResults < ActiveRecord::Migration[5.0] 3 | def change 4 | remove_column :decidim_results_results, :short_description 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170405124720_add_organization_to_identities.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170405094028) 2 | class AddOrganizationToIdentities < ActiveRecord::Migration[5.0] 3 | def change 4 | add_reference :decidim_identities, :decidim_organization, index: true, foreign_key: true 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170427135828_remove_not_null_reference_meetings.decidim_meetings.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_meetings (originally 20170410074252) 2 | class RemoveNotNullReferenceMeetings < ActiveRecord::Migration[5.0] 3 | def change 4 | change_column_null :decidim_meetings_meetings, :reference, true 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20190307141770_add_scope_to_action_logs.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20181211080834) 3 | 4 | class AddScopeToActionLogs < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_action_logs, :decidim_scope_id, :integer 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20210412081141_add_locale_to_moderation_reports.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20201019074554) 3 | 4 | class AddLocaleToModerationReports < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_reports, :locale, :string 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170320140465_add_promoted_flag_to_processes.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20161013134732) 2 | class AddPromotedFlagToProcesses < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_participatory_processes, :promoted, :boolean, default: false, index: true 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170320140523_add_alignment_to_comments.decidim_comments.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_comments (originally 20161216102820) 2 | class AddAlignmentToComments < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_comments_comments, :alignment, :integer, null: false, default: 0 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170320140529_remove_short_description_from_meetings.decidim_meetings.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_meetings (originally 20170129153716) 2 | class RemoveShortDescriptionFromMeetings < ActiveRecord::Migration[5.0] 3 | def change 4 | remove_column :decidim_meetings_meetings, :short_description 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170320140539_add_report_count_to_proposals.decidim_proposals.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_proposals (originally 20170215131720) 2 | class AddReportCountToProposals < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_proposals_proposals, :report_count, :integer, default: 0 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170427135829_remove_not_null_reference_proposals.decidim_proposals.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_proposals (originally 20170410073742) 2 | class RemoveNotNullReferenceProposals < ActiveRecord::Migration[5.0] 3 | def change 4 | change_column_null :decidim_proposals_proposals, :reference, true 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170829072055_add_managed_to_users.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170720135441) 2 | # frozen_string_literal: true 3 | 4 | class AddManagedToUsers < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_users, :managed, :boolean, null: false, default: false 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170320140525_add_user_group_id_to_comments.decidim_comments.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_comments (originally 20170123102043) 2 | class AddUserGroupIdToComments < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_comments_comments, :decidim_user_group_id, :integer, index: true 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20181120111025_add_images_to_content_blocks.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20180808135006) 3 | 4 | class AddImagesToContentBlocks < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_content_blocks, :images, :jsonb, default: {} 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20190307141784_use_big_ints_for_budgets.decidim_budgets.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_budgets (originally 20181205141115) 3 | 4 | class UseBigIntsForBudgets < ActiveRecord::Migration[5.2] 5 | def change 6 | change_column :decidim_budgets_projects, :budget, :bigint 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20201019083064_remove_survey_answers.decidim_surveys.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_surveys (originally 20200610090725) 3 | 4 | class RemoveSurveyAnswers < ActiveRecord::Migration[5.2] 5 | def change 6 | drop_table :decidim_surveys_survey_answers, if_exists: true 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /config/initializers/social_share_button.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # Further information on how to configure the SocialShareButton gem can be 3 | # found here: https://github.com/huacnlee/social-share-button#configure 4 | # 5 | SocialShareButton.configure do |config| 6 | config.allow_sites = %w(twitter facebook google_plus) 7 | end 8 | -------------------------------------------------------------------------------- /config/routes.rb: -------------------------------------------------------------------------------- 1 | require "sidekiq/web" 2 | Rails.application.routes.draw do 3 | authenticate :user, lambda { |u| u.admin? } do 4 | mount Sidekiq::Web => '/sidekiq' 5 | end 6 | 7 | mount Decidim::Core::Engine => '/' 8 | # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20170320140500_add_newsletter_notifications_to_users.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170203150545) 2 | class AddNewsletterNotificationsToUsers < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_users, :newsletter_notifications, :boolean, null: false, default: false 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170320140535_add_user_group_id_to_proposals.decidim_proposals.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_proposals (originally 20170120151202) 2 | class AddUserGroupIdToProposals < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_proposals_proposals, :decidim_user_group_id, :integer, index: true 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170320140550_remove_short_description_from_decidim_projects.decidim_budgets.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_budgets (originally 20170207101750) 2 | class RemoveShortDescriptionFromDecidimProjects < ActiveRecord::Migration[5.0] 3 | def change 4 | remove_column :decidim_budgets_projects, :short_description 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180209123431_add_author_to_debates.decidim_debates.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_debates (originally 20180118132243) 2 | # frozen_string_literal: true 3 | 4 | class AddAuthorToDebates < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_debates_debates, :decidim_author_id, :integer 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180404082741_drop_category_id_column.decidim_debates.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_debates (originally 20180305092347) 2 | # frozen_string_literal: true 3 | 4 | class DropCategoryIdColumn < ActiveRecord::Migration[5.1] 5 | def change 6 | remove_column :decidim_debates_debates, :decidim_category_id 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20190311102113_add_missing_counters_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddMissingCountersToUsers < ActiveRecord::Migration[5.2] 2 | def up 3 | add_column :decidim_users, :following_users_count, :integer, null: false, default: 0 4 | end 5 | 6 | def down 7 | remove_column :decidim_users, :following_users_count 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20200221134115_add_weight_to_categories.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20191118120529) 3 | 4 | class AddWeightToCategories < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_categories, :weight, :integer, null: false, default: 0 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20201019083032_add_id_to_content_blocks_scope.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20200323094443) 3 | 4 | class AddIdToContentBlocksScope < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_content_blocks, :scoped_resource_id, :integer 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20201019083065_remove_survey_questions.decidim_surveys.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_surveys (originally 20200610090845) 3 | 4 | class RemoveSurveyQuestions < ActiveRecord::Migration[5.2] 5 | def change 6 | drop_table :decidim_surveys_survey_questions, if_exists: true 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20210412081140_add_reported_content_to_moderations.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20201013071533) 3 | 4 | class AddReportedContentToModerations < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_moderations, :reported_content, :text 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170320140510_add_secondary_hosts_to_organizations.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170306144354) 2 | class AddSecondaryHostsToOrganizations < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_organizations, :secondary_hosts, :string, array: true, default: [], index: true 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170829072059_attachment_description_nullable.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170804125402) 2 | # frozen_string_literal: true 3 | 4 | class AttachmentDescriptionNullable < ActiveRecord::Migration[5.1] 5 | def change 6 | change_column :decidim_attachments, :description, :jsonb, null: true 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170915091134_add_header_snippets_to_organizations.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170913092351) 2 | # frozen_string_literal: true 3 | 4 | class AddHeaderSnippetsToOrganizations < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_organizations, :header_snippets, :text 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180404082735_add_reference_to_assemblies.decidim_assemblies.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_assemblies (originally 20180125104426) 2 | # frozen_string_literal: true 3 | 4 | class AddReferenceToAssemblies < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_assemblies, :reference, :string 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180404082736_add_area_to_assemblies.decidim_assemblies.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_assemblies (originally 20180216091553) 2 | # frozen_string_literal: true 3 | 4 | class AddAreaToAssemblies < ActiveRecord::Migration[5.1] 5 | def change 6 | add_reference :decidim_assemblies, :decidim_area, index: true 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180514135732_add_title_to_sortition.decidim_sortitions.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_sortitions (originally 20180103082645) 2 | # frozen_string_literal: true 3 | 4 | class AddTitleToSortition < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_module_sortitions_sortitions, :title, :jsonb 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20181120111049_add_position_to_proposals.decidim_proposals.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_proposals (originally 20180930125321) 3 | 4 | class AddPositionToProposals < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_proposals_proposals, :position, :integer 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20190613081740_add_colors_to_decidim_organization.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20190220023422) 3 | 4 | class AddColorsToDecidimOrganization < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_organizations, :colors, :jsonb, default: {} 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20190705112621_add_extended_data_to_newsletters.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20190325145349) 3 | 4 | class AddExtendedDataToNewsletters < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_newsletters, :extended_data, :jsonb, default: {} 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20201019083026_index_foreign_keys_in_decidim_amendments.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20200320105905) 3 | 4 | class IndexForeignKeysInDecidimAmendments < ActiveRecord::Migration[5.2] 5 | def change 6 | add_index :decidim_amendments, :decidim_emendation_id 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20201019083027_index_foreign_keys_in_decidim_authorizations.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20200320105909) 3 | 4 | class IndexForeignKeysInDecidimAuthorizations < ActiveRecord::Migration[5.2] 5 | def change 6 | add_index :decidim_authorizations, :unique_id 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20201019083031_index_foreign_keys_in_oauth_access_grants.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20200320105927) 3 | 4 | class IndexForeignKeysInOAuthAccessGrants < ActiveRecord::Migration[5.2] 5 | def change 6 | add_index :oauth_access_grants, :resource_owner_id 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20210412081158_add_online_meeting_url.decidim_meetings.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_meetings (originally 20201006140511) 3 | 4 | class AddOnlineMeetingUrl < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_meetings_meetings, :online_meeting_url, :string 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170320140486_add_uniqueness_field_to_authorizations.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170117142904) 2 | class AddUniquenessFieldToAuthorizations < ActiveRecord::Migration[5.0] 3 | def change 4 | change_table :decidim_authorizations do |t| 5 | t.string :unique_id, null: true 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180514135712_add_services_to_meetings.decidim_meetings.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_meetings (originally 20180407110934) 2 | # frozen_string_literal: true 3 | 4 | class AddServicesToMeetings < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_meetings_meetings, :services, :jsonb, default: [] 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180615103566_add_organizer_to_meetings.decidim_meetings.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_meetings (originally 20180404075312) 3 | 4 | class AddOrganizerToMeetings < ActiveRecord::Migration[5.1] 5 | def change 6 | add_reference :decidim_meetings_meetings, :organizer, index: true 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20181120111023_rename_content_block_options_to_settings.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20180802132147) 3 | 4 | class RenameContentBlockOptionsToSettings < ActiveRecord::Migration[5.2] 5 | def change 6 | rename_column :decidim_content_blocks, :options, :settings 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20201019083023_add_organization_timezone.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20200107142226) 3 | 4 | class AddOrganizationTimezone < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_organizations, :time_zone, :string, limit: 255, default: "UTC" 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20201019083070_add_user_group_author_to_blogs.decidim_blogs.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_blogs (originally 20191212162606) 3 | 4 | class AddUserGroupAuthorToBlogs < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_blogs_posts, :decidim_user_group_id, :integer 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20210412081134_remove_show_statistics_from_organizations.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20200929171508) 3 | 4 | class RemoveShowStatisticsFromOrganizations < ActiveRecord::Migration[5.2] 5 | def change 6 | remove_column :decidim_organizations, :show_statistics 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20210412081139_add_current_suspension_id_to_decidim_users.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20201011081626) 3 | 4 | class AddCurrentSuspensionIdToDecidimUsers < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_users, :suspension_id, :integer 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180209123430_add_debate_information_updates.decidim_debates.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_debates (originally 20180117100413) 2 | # frozen_string_literal: true 3 | 4 | class AddDebateInformationUpdates < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_debates_debates, :information_updates, :jsonb 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20190705112620_add_smtp_settings_to_decidim_organizations.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20181219130325) 3 | 4 | class AddSmtpSettingsToDecidimOrganizations < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_organizations, :smtp_settings, :jsonb 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20201019083029_index_foreign_keys_in_decidim_endorsements.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20200320105919) 3 | 4 | class IndexForeignKeysInDecidimEndorsements < ActiveRecord::Migration[5.2] 5 | def change 6 | add_index :decidim_endorsements, :decidim_user_group_id 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20201019083030_index_foreign_keys_in_decidim_notifications.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20200320105923) 3 | 4 | class IndexForeignKeysInDecidimNotifications < ActiveRecord::Migration[5.2] 5 | def change 6 | add_index :decidim_notifications, :decidim_resource_id 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20201019083062_remove_survey_answer_choices.decidim_surveys.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_surveys (originally 20200610090533) 3 | 4 | class RemoveSurveyAnswerChoices < ActiveRecord::Migration[5.2] 5 | def change 6 | drop_table :decidim_surveys_survey_answer_choices, if_exists: true 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20201019083063_remove_survey_answer_options.decidim_surveys.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_surveys (originally 20200610090650) 3 | 4 | class RemoveSurveyAnswerOptions < ActiveRecord::Migration[5.2] 5 | def change 6 | drop_table :decidim_surveys_survey_answer_options, if_exists: true 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20210114102033_rename_budget_to_budget_ammount.decidim_budgets.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_budgets (originally 20200629072626) 3 | 4 | class RenameBudgetToBudgetAmmount < ActiveRecord::Migration[5.2] 5 | def change 6 | rename_column :decidim_budgets_projects, :budget, :budget_amount 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20210114102038_add_selected_at_to_project.decidim_budgets.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_budgets (originally 20200728075039) 3 | 4 | class AddSelectedAtToProject < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_budgets_projects, :selected_at, :date, index: true 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20210412081146_add_email_on_moderations_to_users.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20210208134328) 3 | 4 | class AddEmailOnModerationsToUsers < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_users, :email_on_moderations, :boolean, default: true 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180209123428_add_index_created_at_proposal_notes.decidim_proposals.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_proposals (originally 20180115155220) 2 | # frozen_string_literal: true 3 | 4 | class AddIndexCreatedAtProposalNotes < ActiveRecord::Migration[5.1] 5 | def change 6 | add_index :decidim_proposals_proposal_notes, :created_at 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180514135704_add_reason_to_decidim_impersonation_logs.decidim_admin.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_admin (originally 20180413233318) 2 | # frozen_string_literal: true 3 | 4 | class AddReasonToDecidimImpersonationLogs < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_impersonation_logs, :reason, :text 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180514135706_add_private_to_assemblies.decidim_assemblies.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_assemblies (originally 20180124083729) 2 | # frozen_string_literal: true 3 | 4 | class AddPrivateToAssemblies < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_assemblies, :private_space, :boolean, default: false 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180514135728_add_witnesses_to_sortitions.decidim_sortitions.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_sortitions (originally 20171220164658) 2 | # frozen_string_literal: true 3 | 4 | class AddWitnessesToSortitions < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_module_sortitions_sortitions, :witnesses, :jsonb 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180615103571_add_weight_to_results.decidim_accountability.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_accountability (originally 20180508170210) 3 | 4 | class AddWeightToResults < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_accountability_results, :weight, :float, default: 1.0 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20201019083072_index_foreign_keys_in_decidim_blogs_posts.decidim_blogs.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_blogs (originally 20200320105910) 3 | 4 | class IndexForeignKeysInDecidimBlogsPosts < ActiveRecord::Migration[5.2] 5 | def change 6 | add_index :decidim_blogs_posts, :decidim_user_group_id 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20210114102037_add_scope_to_budgets.decidim_budgets.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_budgets (originally 20200717140012) 3 | 4 | class AddScopeToBudgets < ActiveRecord::Migration[5.2] 5 | def change 6 | add_reference :decidim_budgets_budgets, :decidim_scope, foreign_key: true, index: true 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20210412081159_add_type_of_meeting.decidim_meetings.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_meetings (originally 20201009124057) 3 | 4 | class AddTypeOfMeeting < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_meetings_meetings, :type_of_meeting, :string, default: "in_person" 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170320140534_add_counter_cache_votes_to_proposals.decidim_proposals.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_proposals (originally 20170118120151) 2 | class AddCounterCacheVotesToProposals < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_proposals_proposals, :proposal_votes_count, :integer, null: false, default: 0 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170616093820_add_mandatory_to_surveys_questions.decidim_surveys.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_surveys (originally 20170522075938) 2 | # frozen_string_literal: true 3 | 4 | class AddMandatoryToSurveysQuestions < ActiveRecord::Migration[5.0] 5 | def change 6 | add_column :decidim_surveys_survey_questions, :mandatory, :boolean 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170829072060_add_announcement_to_participatory_processes.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170808080905) 2 | # frozen_string_literal: true 3 | 4 | class AddAnnouncementToParticipatoryProcesses < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_participatory_processes, :announcement, :jsonb 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180209123417_extend_user_profile.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20180115090038) 2 | # frozen_string_literal: true 3 | 4 | class ExtendUserProfile < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_users, :personal_url, :string 7 | add_column :decidim_users, :about, :text 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20180209123433_add_user_group_author_to_debates.decidim_debates.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_debates (originally 20180122090505) 2 | # frozen_string_literal: true 3 | 4 | class AddUserGroupAuthorToDebates < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_debates_debates, :decidim_user_group_id, :integer 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180514135730_add_author_to_sortitions.decidim_sortitions.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_sortitions (originally 20180102100101) 2 | # frozen_string_literal: true 3 | 4 | class AddAuthorToSortitions < ActiveRecord::Migration[5.1] 5 | def change 6 | add_reference :decidim_module_sortitions_sortitions, :decidim_author, index: true 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180514135737_rename_sortitions_table.decidim_sortitions.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_sortitions (originally 20180108132729) 2 | # frozen_string_literal: true 3 | 4 | class RenameSortitionsTable < ActiveRecord::Migration[5.1] 5 | def change 6 | rename_table :decidim_module_sortitions_sortitions, :decidim_sortitions_sortitions 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180514135741_add_author_to_decidim_blogs_posts.decidim_blogs.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_blogs (originally 20171211084630) 2 | # frozen_string_literal: true 3 | 4 | class AddAuthorToDecidimBlogsPosts < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_blogs_posts, :decidim_author_id, :integer, index: true 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20190307141782_add_created_in_meeting.decidim_proposals.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_proposals (originally 20181026073215) 3 | 4 | class AddCreatedInMeeting < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_proposals_proposals, :created_in_meeting, :boolean, default: false 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20201019083018_add_omniauth_settings_to_decidim_organization.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20191113092826) 3 | 4 | class AddOmniauthSettingsToDecidimOrganization < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_organizations, :omniauth_settings, :jsonb 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20201019083047_index_foreign_keys_in_decidim_assemblies.decidim_assemblies.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_assemblies (originally 20200320105906) 3 | 4 | class IndexForeignKeysInDecidimAssemblies < ActiveRecord::Migration[5.2] 5 | def change 6 | add_index :decidim_assemblies, :decidim_scope_id 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170320140508_add_scopes_to_processes.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170221094835) 2 | class AddScopesToProcesses < ActiveRecord::Migration[5.0] 3 | def change 4 | rename_column :decidim_participatory_processes, :scope, :meta_scope 5 | add_column :decidim_participatory_processes, :decidim_scope_id, :integer 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20170915091135_remove_followable_index_from_follows.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170914075721) 2 | # frozen_string_literal: true 3 | 4 | class RemoveFollowableIndexFromFollows < ActiveRecord::Migration[5.1] 5 | def change 6 | remove_index :decidim_follows, [:decidim_followable_id, :decidim_followable_type] 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180514135717_add_max_choices_to_survey_questions.decidim_surveys.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_surveys (originally 20180314225829) 2 | # frozen_string_literal: true 3 | 4 | class AddMaxChoicesToSurveyQuestions < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_surveys_survey_questions, :max_choices, :integer 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20201019083037_add_accepted_admin_terms_at_field_to_users.decidim_admin.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_admin (originally 20191118112040) 3 | 4 | class AddAcceptedAdminTermsAtFieldToUsers < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_users, :admin_terms_accepted_at, :datetime 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20210114102035_add_budget_reference_to_order.decidim_budgets.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_budgets (originally 20200706142609) 3 | 4 | class AddBudgetReferenceToOrder < ActiveRecord::Migration[5.2] 5 | def change 6 | add_reference :decidim_budgets_orders, :decidim_budgets_budget, foreign_key: true 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20210412081156_add_weight_field_to_assembly.decidim_assemblies.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_assemblies (originally 20210204152393) 3 | 4 | class AddWeightFieldToAssembly < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_assemblies, :weight, :integer, null: false, default: true 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20210412081167_add_scope_to_debates_debate.decidim_debates.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_debates (originally 20200930145546) 3 | 4 | class AddScopeToDebatesDebate < ActiveRecord::Migration[5.2] 5 | def change 6 | add_reference :decidim_debates_debates, :decidim_scope, foreign_key: true, index: true 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170405124719_change_decidim_user_email_index_uniqueness.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170405091801) 2 | class ChangeDecidimUserEmailIndexUniqueness < ActiveRecord::Migration[5.0] 3 | def change 4 | remove_index :decidim_users, :email 5 | add_index :decidim_users, [:email, :decidim_organization_id], unique: true 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20170616093819_add_position_to_surveys_questions.decidim_surveys.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_surveys (originally 20170518085302) 2 | # frozen_string_literal: true 3 | 4 | class AddPositionToSurveysQuestions < ActiveRecord::Migration[5.0] 5 | def change 6 | add_column :decidim_surveys_survey_questions, :position, :integer, index: true 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170616093821_add_question_type_to_surveys_questions.decidim_surveys.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_surveys (originally 20170524122229) 2 | # frozen_string_literal: true 3 | 4 | class AddQuestionTypeToSurveysQuestions < ActiveRecord::Migration[5.0] 5 | def change 6 | add_column :decidim_surveys_survey_questions, :question_type, :string 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180514135722_add_free_text_to_survey_answer_options.decidim_surveys.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_surveys (originally 20180405015258) 2 | # frozen_string_literal: true 3 | 4 | class AddFreeTextToSurveyAnswerOptions < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_surveys_survey_answer_options, :free_text, :boolean 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180514135729_add_additional_info_to_sortitions.decidim_sortitions.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_sortitions (originally 20171220164744) 2 | # frozen_string_literal: true 3 | 4 | class AddAdditionalInfoToSortitions < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_module_sortitions_sortitions, :additional_info, :jsonb 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180615103572_add_external_id_to_results.decidim_accountability.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_accountability (originally 20180508170647) 3 | 4 | class AddExternalIdToResults < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_accountability_results, :external_id, :string, index: true 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20201019083028_index_foreign_keys_in_decidim_contextual_help_sections.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20200320105917) 3 | 4 | class IndexForeignKeysInDecidimContextualHelpSections < ActiveRecord::Migration[5.2] 5 | def change 6 | add_index :decidim_contextual_help_sections, :section_id 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20201019083058_add_state_published_at_to_proposals.decidim_proposals.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_proposals (originally 20200227175922) 3 | 4 | class AddStatePublishedAtToProposals < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_proposals_proposals, :state_published_at, :datetime 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20201019083068_index_foreign_keys_in_decidim_debates_debates.decidim_debates.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_debates (originally 20200320105918) 3 | 4 | class IndexForeignKeysInDecidimDebatesDebates < ActiveRecord::Migration[5.2] 5 | def change 6 | add_index :decidim_debates_debates, :decidim_user_group_id 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20210114102034_add_budget_reference_to_project.decidim_budgets.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_budgets (originally 20200629134013) 3 | 4 | class AddBudgetReferenceToProject < ActiveRecord::Migration[5.2] 5 | def change 6 | add_reference :decidim_budgets_projects, :decidim_budgets_budget, foreign_key: true 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170915091133_add_emails_on_notifications_flag_to_user.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170912082054) 2 | # frozen_string_literal: true 3 | 4 | class AddEmailsOnNotificationsFlagToUser < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_users, :email_on_notification, :boolean, default: false, null: false 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180209123421_add_omnipresent_banner_url_to_decidim_organizations.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20180123125452) 2 | # frozen_string_literal: true 3 | 4 | class AddOmnipresentBannerUrlToDecidimOrganizations < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_organizations, :omnipresent_banner_url, :string 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180404082734_add_reference_to_processes.decidim_participatory_processes.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_participatory_processes (originally 20180125102537) 2 | # frozen_string_literal: true 3 | 4 | class AddReferenceToProcesses < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_participatory_processes, :reference, :string 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180514135711_add_fields_for_registrations.decidim_meetings.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_meetings (originally 20180326082611) 2 | # frozen_string_literal: true 3 | 4 | class AddFieldsForRegistrations < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_meetings_meetings, :reserved_slots, :integer, null: false, default: 0 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180514135718_add_description_to_decidim_survey_questions.decidim_surveys.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_surveys (originally 20180321141024) 2 | # frozen_string_literal: true 3 | 4 | class AddDescriptionToDecidimSurveyQuestions < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_surveys_survey_questions, :description, :jsonb 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180514135723_add_custom_body_to_survey_answer_choices.decidim_surveys.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_surveys (originally 20180405015314) 2 | # frozen_string_literal: true 3 | 4 | class AddCustomBodyToSurveyAnswerChoices < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_surveys_survey_answer_choices, :custom_body, :text 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180514135735_make_sortition_reference_nullable.decidim_sortitions.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_sortitions (originally 20180104143054) 2 | # frozen_string_literal: true 3 | 4 | class MakeSortitionReferenceNullable < ActiveRecord::Migration[5.1] 5 | def change 6 | change_column_null :decidim_module_sortitions_sortitions, :reference, true 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170616093807_add_deleted_fields_to_users.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170605140421) 2 | # frozen_string_literal: true 3 | 4 | class AddDeletedFieldsToUsers < ActiveRecord::Migration[5.0] 5 | def change 6 | add_column :decidim_users, :delete_reason, :text 7 | add_column :decidim_users, :deleted_at, :datetime 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20180209123419_add_omnipresent_banner_title_to_decidim_organizations.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20180123125409) 2 | # frozen_string_literal: true 3 | 4 | class AddOmnipresentBannerTitleToDecidimOrganizations < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_organizations, :omnipresent_banner_title, :jsonb 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180209123425_add_scopes_enabled_to_assemblies.decidim_assemblies.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_assemblies (originally 20170822153055) 2 | # frozen_string_literal: true 3 | 4 | class AddScopesEnabledToAssemblies < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_assemblies, :scopes_enabled, :boolean, null: false, default: true 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20181120111040_add_code_to_decidim_meetings_registrations.decidim_meetings.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_meetings (originally 20180615160839) 3 | 4 | class AddCodeToDecidimMeetingsRegistrations < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_meetings_registrations, :code, :string, index: true 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20190705112625_add_user_group_to_meetings_registrations.decidim_meetings.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_meetings (originally 20190404132923) 3 | 4 | class AddUserGroupToMeetingsRegistrations < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_meetings_registrations, :decidim_user_group_id, :bigint 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20201019083051_index_foreign_keys_in_decidim_comments_comments.decidim_comments.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_comments (originally 20200320105911) 3 | 4 | class IndexForeignKeysInDecidimCommentsComments < ActiveRecord::Migration[5.2] 5 | def change 6 | add_index :decidim_comments_comments, :decidim_user_group_id 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20210114102014_add_comments_max_length_to_decidim_organization.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20200707132401) 3 | 4 | class AddCommentsMaxLengthToDecidimOrganization < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_organizations, :comments_max_length, :integer, default: 1000 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170320140528_add_latitude_and_longitude_to_meetings.decidim_meetings.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_meetings (originally 20170123151650) 2 | class AddLatitudeAndLongitudeToMeetings < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_meetings_meetings, :latitude, :float 5 | add_column :decidim_meetings_meetings, :longitude, :float 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20170616093822_add_answer_options_to_surveys_questions.decidim_surveys.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_surveys (originally 20170525132233) 2 | # frozen_string_literal: true 3 | 4 | class AddAnswerOptionsToSurveysQuestions < ActiveRecord::Migration[5.0] 5 | def change 6 | add_column :decidim_surveys_survey_questions, :answer_options, :jsonb, default: [] 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170803094941_add_show_statistics_to_participatory_processes.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170725085104) 2 | # frozen_string_literal: true 3 | 4 | class AddShowStatisticsToParticipatoryProcesses < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_participatory_processes, :show_statistics, :boolean, default: true 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180404082732_add_weight_to_attachments.decidim_participatory_processes.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_participatory_processes (originally 20171215081244) 2 | # frozen_string_literal: true 3 | 4 | class AddWeightToAttachments < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_attachments, :weight, :integer, null: false, default: 0 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180514135724_add_position_to_decidim_survey_answer_choices.decidim_surveys.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_surveys (originally 20180406201818) 2 | # frozen_string_literal: true 3 | 4 | class AddPositionToDecidimSurveyAnswerChoices < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_surveys_survey_answer_choices, :position, :integer 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180514135736_add_candidate_proposals_to_sortitions.decidim_sortitions.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_sortitions (originally 20180104145344) 2 | # frozen_string_literal: true 3 | 4 | class AddCandidateProposalsToSortitions < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_module_sortitions_sortitions, :candidate_proposals, :jsonb 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20181120111048_add_participatory_text_level_to_proposals.decidim_proposals.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_proposals (originally 20180930125321) 3 | 4 | class AddParticipatoryTextLevelToProposals < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_proposals_proposals, :participatory_text_level, :string 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20201019083048_index_foreign_keys_in_decidim_assembly_user_roles.decidim_assemblies.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_assemblies (originally 20200320105907) 3 | 4 | class IndexForeignKeysInDecidimAssemblyUserRoles < ActiveRecord::Migration[5.2] 5 | def change 6 | add_index :decidim_assembly_user_roles, :decidim_user_id 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20201019083071_add_endorsements_counter_cache_to_blogs.decidim_blogs.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_blogs (originally 20200128094730) 3 | 4 | class AddEndorsementsCounterCacheToBlogs < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_blogs_posts, :endorsements_count, :integer, null: false, default: 0 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20210412081148_add_max_characters_to_decidim_forms_questions.decidim_forms.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_forms (originally 20210208094442) 3 | 4 | class AddMaxCharactersToDecidimFormsQuestions < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_forms_questions, :max_characters, :integer, default: 0 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20210412081168_archive_debates.decidim_debates.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_debates (originally 20201126112752) 3 | 4 | class ArchiveDebates < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_debates_debates, :archived_at, :datetime 7 | add_index :decidim_debates_debates, :archived_at 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20170320140485_loosen_step_requirements.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170116135237) 2 | class LoosenStepRequirements < ActiveRecord::Migration[5.0] 3 | def change 4 | change_column_null(:decidim_participatory_process_steps, :short_description, true) 5 | change_column_null(:decidim_participatory_process_steps, :description, true) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20190307141764_add_users_registration_mode_to_organizations.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20181108131058) 3 | 4 | class AddUsersRegistrationModeToOrganizations < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_organizations, :users_registration_mode, :integer, default: 0, null: false 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170427135827_change_steps_end_and_start_date_to_date.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170404132616) 2 | class ChangeStepsEndAndStartDateToDate < ActiveRecord::Migration[5.0] 3 | def change 4 | change_column :decidim_participatory_process_steps, :start_date, :date 5 | change_column :decidim_participatory_process_steps, :end_date, :date 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20170829072061_add_scopes_enabled_to_participatory_processes.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170809084005) 2 | # frozen_string_literal: true 3 | 4 | class AddScopesEnabledToParticipatoryProcesses < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_participatory_processes, :scopes_enabled, :boolean, null: false, default: true 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20171031144632_add_children_counter_cache_to_results.decidim_accountability.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_accountability (originally 20170623144902) 2 | # frozen_string_literal: true 3 | 4 | class AddChildrenCounterCacheToResults < ActiveRecord::Migration[5.0] 5 | def change 6 | add_column :decidim_accountability_results, :children_count, :integer, default: 0 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20181120111041_add_validated_at_to_decidim_meetings_registrations.decidim_meetings.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_meetings (originally 20180711111023) 3 | 4 | class AddValidatedAtToDecidimMeetingsRegistrations < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_meetings_registrations, :validated_at, :datetime 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20201019083042_index_foreign_keys_in_decidim_attachments.decidim_participatory_processes.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_participatory_processes (originally 20200320105908) 3 | 4 | class IndexForeignKeysInDecidimAttachments < ActiveRecord::Migration[5.2] 5 | def change 6 | add_index :decidim_attachments, :attachment_collection_id 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20201019083052_index_foreign_keys_in_decidim_meetings_registrations.decidim_meetings.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_meetings (originally 20200320105922) 3 | 4 | class IndexForeignKeysInDecidimMeetingsRegistrations < ActiveRecord::Migration[5.2] 5 | def change 6 | add_index :decidim_meetings_registrations, :decidim_user_group_id 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20201019083067_index_foreign_keys_in_decidim_accountability_results.decidim_accountability.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_accountability (originally 20200320105903) 3 | 4 | class IndexForeignKeysInDecidimAccountabilityResults < ActiveRecord::Migration[5.2] 5 | def change 6 | add_index :decidim_accountability_results, :external_id 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20201019083069_index_foreign_keys_in_decidim_sortitions_sortitions.decidim_sortitions.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_sortitions (originally 20200320105926) 3 | 4 | class IndexForeignKeysInDecidimSortitionsSortitions < ActiveRecord::Migration[5.2] 5 | def change 6 | add_index :decidim_sortitions_sortitions, :cancelled_by_user_id 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20210412081169_revert_archive_debates.decidim_debates.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_debates (originally 20210125101735) 3 | 4 | class RevertArchiveDebates < ActiveRecord::Migration[5.2] 5 | def change 6 | remove_index :decidim_debates_debates, :archived_at 7 | remove_column :decidim_debates_debates, :archived_at 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20170721075616_add_admin_to_users.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170713131206) 2 | # frozen_string_literal: true 3 | 4 | class AddAdminToUsers < ActiveRecord::Migration[5.1] 5 | def up 6 | add_column :decidim_users, :admin, :boolean, null: false, default: false 7 | Decidim::User.where("roles @> ?", "{admin}").update_all(admin: true) 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20190705112624_add_area_to_participatory_processes.decidim_participatory_processes.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_participatory_processes (originally 20190322125517) 3 | 4 | class AddAreaToParticipatoryProcesses < ActiveRecord::Migration[5.2] 5 | def change 6 | add_reference :decidim_participatory_processes, :decidim_area, index: true 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170320140474_create_decidim_features.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20161110105712) 2 | class CreateDecidimFeatures < ActiveRecord::Migration[5.0] 3 | def change 4 | create_table :decidim_features do |t| 5 | t.string :manifest_name 6 | t.jsonb :name 7 | t.references :decidim_participatory_process, index: true 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20181120111027_add_visibility_to_action_logs.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20180918072506) 3 | 4 | class AddVisibilityToActionLogs < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_action_logs, :visibility, :string, default: "admin-only" 7 | add_index :decidim_action_logs, :visibility 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20181120111051_add_temporary_votes.decidim_proposals.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_proposals (originally 20181010114622) 3 | 4 | class AddTemporaryVotes < ActiveRecord::Migration[5.2] 5 | def change 6 | change_table :decidim_proposals_proposal_votes do |t| 7 | t.boolean :temporary, null: false, default: false 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20210114102012_add_enable_machine_translation_to_decidim_organizations.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20200525184143) 3 | 4 | class AddEnableMachineTranslationToDecidimOrganizations < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_organizations, :enable_machine_translations, :boolean, default: false 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20210114102017_remove_notifications_with_continuity_badge.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20201004160335) 3 | 4 | class RemoveNotificationsWithContinuityBadge < ActiveRecord::Migration[5.2] 5 | def up 6 | Decidim::Notification.where("extra->>'badge_name' =?", "continuity").delete_all 7 | end 8 | 9 | def down; end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20170320140502_add_published_at_to_decidim_features.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170206142116) 2 | class AddPublishedAtToDecidimFeatures < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_features, :published_at, :datetime 5 | execute "UPDATE decidim_features SET published_at=#{ActiveRecord::Base.connection.quote(Time.current)}" 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20171212150150_add_verification_attachment_to_authorizations.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20171013124505) 2 | # frozen_string_literal: true 3 | 4 | class AddVerificationAttachmentToAuthorizations < ActiveRecord::Migration[5.1] 5 | def change 6 | change_table :decidim_authorizations do |t| 7 | t.string :verification_attachment 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20201019083053_add_endorsements_counter_cache_to_proposals.decidim_proposals.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_proposals (originally 20191206154128) 3 | 4 | class AddEndorsementsCounterCacheToProposals < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_proposals_proposals, :endorsements_count, :integer, null: false, default: 0 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20210412081150_add_hashtag_to_participatory_process_groups.decidim_participatory_processes.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_participatory_processes (originally 20201007215105) 3 | 4 | class AddHashtagToParticipatoryProcessGroups < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_participatory_process_groups, :hashtag, :string 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170320140546_add_reference_to_results.decidim_results.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_results (originally 20170215132624) 2 | class AddReferenceToResults < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_results_results, :reference, :string 5 | Decidim::Results::Result.find_each(&:save) 6 | change_column_null :decidim_results_results, :reference, false 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170721075618_rename_participatory_process_user_roles_table.decidim_admin.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_admin (originally 20170714083651) 2 | # frozen_string_literal: true 3 | 4 | class RenameParticipatoryProcessUserRolesTable < ActiveRecord::Migration[5.1] 5 | def change 6 | rename_table :decidim_admin_participatory_process_user_roles, :decidim_participatory_process_user_roles 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20171212150148_add_status_to_authorizations.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170914092117) 2 | # frozen_string_literal: true 3 | 4 | class AddStatusToAuthorizations < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_authorizations, :granted_at, :datetime 7 | 8 | execute "UPDATE decidim_authorizations SET granted_at = updated_at" 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180209123418_add_enable_omnipresent_banner_to_decidim_organizations.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20180123125308) 2 | # frozen_string_literal: true 3 | 4 | class AddEnableOmnipresentBannerToDecidimOrganizations < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_organizations, :enable_omnipresent_banner, :boolean, null: false, default: false 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180209123420_add_omnipresent_banner_short_description_to_decidim_organizations.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20180123125432) 2 | # frozen_string_literal: true 3 | 4 | class AddOmnipresentBannerShortDescriptionToDecidimOrganizations < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_organizations, :omnipresent_banner_short_description, :jsonb 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20190307141780_add_registration_form_enabled_to_decidim_meetings.decidim_meetings.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_meetings (originally 20180801150031) 3 | 4 | class AddRegistrationFormEnabledToDecidimMeetings < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_meetings_meetings, :registration_form_enabled, :boolean, default: false 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170320140517_create_decidim_pages.decidim_pages.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_pages (originally 20161116121353) 2 | class CreateDecidimPages < ActiveRecord::Migration[5.0] 3 | def change 4 | create_table :decidim_pages_pages do |t| 5 | t.jsonb :title 6 | t.jsonb :body 7 | t.references :decidim_feature, index: true 8 | 9 | t.timestamps 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20170320140551_add_reference_to_projects.decidim_budgets.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_budgets (originally 20170215132708) 2 | class AddReferenceToProjects < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_budgets_projects, :reference, :string 5 | Decidim::Budgets::Project.find_each(&:save) 6 | change_column_null :decidim_budgets_projects, :reference, false 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180514135705_add_private_to_participatory_processes.decidim_participatory_processes.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_participatory_processes (originally 20180122110007) 2 | # frozen_string_literal: true 3 | 4 | class AddPrivateToParticipatoryProcesses < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_participatory_processes, :private_space, :boolean, default: false 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180615103563_assembly_member_belongs_to_user.decidim_assemblies.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_assemblies (originally 20180426162405) 3 | 4 | class AssemblyMemberBelongsToUser < ActiveRecord::Migration[5.1] 5 | def change 6 | add_reference :decidim_assembly_members, :decidim_user, index: { name: "index_decidim_assembly_members_on_decidim_user_id" } 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20210218074155_add_salt_to_decidim_meetings.decidim_meetings.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_meetings (originally 20201111133246) 3 | 4 | class AddSaltToDecidimMeetings < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_meetings_meetings, :salt, :string 7 | # we leave old entries empty to maintain the old pad reference 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20170320140530_add_reference_to_meetings.decidim_meetings.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_meetings (originally 20170215132546) 2 | class AddReferenceToMeetings < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_meetings_meetings, :reference, :string 5 | Decidim::Meetings::Meeting.find_each(&:save) 6 | change_column_null :decidim_meetings_meetings, :reference, false 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180615103564_update_assembly_members_index.decidim_assemblies.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_assemblies (originally 20180515073049) 3 | 4 | class UpdateAssemblyMembersIndex < ActiveRecord::Migration[5.1] 5 | def change 6 | remove_index :decidim_assembly_members, column: :weight 7 | add_index :decidim_assembly_members, [:weight, :created_at] 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20201019083020_add_admin_terms_of_use_body_field_to_organization.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20191118123154) 3 | 4 | class AddAdminTermsOfUseBodyFieldToOrganization < ActiveRecord::Migration[5.2] 5 | def change 6 | change_table :decidim_organizations do |t| 7 | t.jsonb :admin_terms_of_use_body, null: true 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20201019083041_add_show_metrics_to_participatory_processes.decidim_participatory_processes.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_participatory_processes (originally 20200204154917) 3 | 4 | class AddShowMetricsToParticipatoryProcesses < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_participatory_processes, :show_metrics, :boolean, default: true 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170320140473_add_index_for_process_slug_organization.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20161110092735) 2 | class AddIndexForProcessSlugOrganization < ActiveRecord::Migration[5.0] 3 | def change 4 | add_index :decidim_participatory_processes, 5 | [:decidim_organization_id, :slug], 6 | unique: true, 7 | name: "index_unique_process_slug_and_organization" 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20170320140477_create_decidim_scopes.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20161130105257) 2 | class CreateDecidimScopes < ActiveRecord::Migration[5.0] 3 | def change 4 | create_table :decidim_scopes do |t| 5 | t.string :name, null: false, index: :uniqueness 6 | t.references :decidim_organization, foreign_key: true, index: true 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20170320140487_create_user_groups.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170119145359) 2 | class CreateUserGroups < ActiveRecord::Migration[5.0] 3 | def change 4 | create_table :decidim_user_groups do |t| 5 | t.string :name, null: false 6 | t.string :document_number, null: false 7 | t.string :phone, null: false 8 | 9 | t.timestamps 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20171031144626_add_cta_button_url_and_text_to_organization.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20171017084546) 2 | # frozen_string_literal: true 3 | 4 | class AddCtaButtonUrlAndTextToOrganization < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_organizations, :cta_button_text, :jsonb 7 | add_column :decidim_organizations, :cta_button_path, :string 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20210412081137_add_suspension_fields_to_decidim_users.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20201010224433) 3 | 4 | class AddSuspensionFieldsToDecidimUsers < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_users, :suspended, :boolean, default: false, null: false 7 | add_column :decidim_users, :suspended_at, :datetime 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/assets/stylesheets/decidim.scss: -------------------------------------------------------------------------------- 1 | // // Variables 2 | // 3 | $primary: #e41915; 4 | // $secondary: #599aa6; 5 | // $success: #57d685; 6 | // $warning: #ffae00; 7 | // $alert: #ec5840; 8 | // 9 | // $proposals: #238FF7; 10 | // $actions: #57D685; 11 | // $debates: #FA6C96; 12 | // $meetings: #FABC6C; 13 | // 14 | // $twitter: #55acee; 15 | // $facebook: #3b5998; 16 | // $google: #dd4b39; 17 | 18 | @import "decidim/application"; 19 | -------------------------------------------------------------------------------- /db/migrate/20170320140504_add_organization_logo_and_url.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170207093048) 2 | class AddOrganizationLogoAndUrl < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_organizations, :official_img_header, :string 5 | add_column :decidim_organizations, :official_img_footer, :string 6 | add_column :decidim_organizations, :official_url, :string 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170320140533_add_text_search_indexes.decidim_proposals.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_proposals (originally 20170113114245) 2 | class AddTextSearchIndexes < ActiveRecord::Migration[5.0] 3 | def change 4 | add_index :decidim_proposals_proposals, :title, name: "decidim_proposals_proposal_title_search" 5 | add_index :decidim_proposals_proposals, :body, name: "decidim_proposals_proposal_body_search" 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20170320140540_add_reference_to_proposals.decidim_proposals.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_proposals (originally 20170215132030) 2 | class AddReferenceToProposals < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_proposals_proposals, :reference, :string 5 | Decidim::Proposals::Proposal.find_each(&:save) 6 | change_column_null :decidim_proposals_proposals, :reference, false 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170915091136_remove_comment_and_replies_notifications_from_users.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170914092116) 2 | # frozen_string_literal: true 3 | 4 | class RemoveCommentAndRepliesNotificationsFromUsers < ActiveRecord::Migration[5.1] 5 | def change 6 | remove_column :decidim_users, :comments_notifications 7 | remove_column :decidim_users, :replies_notifications 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20210412081154_add_weight_field_to_participatory_processes.decidim_participatory_processes.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_participatory_processes (originally 20210204154593) 3 | 4 | class AddWeightFieldToParticipatoryProcesses < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_participatory_processes, :weight, :integer, null: false, default: true 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /app/assets/javascripts/cable.js: -------------------------------------------------------------------------------- 1 | // Action Cable provides the framework to deal with WebSockets in Rails. 2 | // You can generate new channels where WebSocket features live using the rails generate channel command. 3 | // 4 | //= require action_cable 5 | //= require_self 6 | //= require_tree ./channels 7 | 8 | (function() { 9 | this.App || (this.App = {}); 10 | 11 | App.cable = ActionCable.createConsumer(); 12 | 13 | }).call(this); 14 | -------------------------------------------------------------------------------- /db/migrate/20170522083322_add_root_commentable_to_comments.decidim_comments.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_comments (originally 20170504085413) 2 | class AddRootCommentableToComments < ActiveRecord::Migration[5.0] 3 | def change 4 | change_table :decidim_comments_comments do |t| 5 | t.references :decidim_root_commentable, polymorphic: true, index: { name: "decidim_comments_comment_root_commentable" } 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170522083324_set_root_commentable_null_constraints.decidim_comments.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_comments (originally 20170510091409) 2 | class SetRootCommentableNullConstraints < ActiveRecord::Migration[5.0] 3 | def change 4 | change_column_null(:decidim_comments_comments, :decidim_root_commentable_id, false) 5 | change_column_null(:decidim_comments_comments, :decidim_root_commentable_type, false) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180615103565_add_meeting_types.decidim_meetings.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_meetings (originally 20180403145218) 3 | 4 | class AddMeetingTypes < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_meetings_meetings, :private_meeting, :boolean, default: false 7 | add_column :decidim_meetings_meetings, :transparent, :boolean, default: true 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20201019083040_add_scope_type_to_participatory_processes.decidim_participatory_processes.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_participatory_processes (originally 20200114142253) 3 | 4 | class AddScopeTypeToParticipatoryProcesses < ActiveRecord::Migration[5.2] 5 | def change 6 | add_reference :decidim_participatory_processes, :decidim_scope_type, foreign_key: true, index: true 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20201019083049_remove_legacy_decidim_assembly_type.decidim_assemblies.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_assemblies (originally 20200416132109) 3 | 4 | class RemoveLegacyDecidimAssemblyType < ActiveRecord::Migration[5.2] 5 | def change 6 | remove_column :decidim_assemblies, :assembly_type, :string 7 | remove_column :decidim_assemblies, :assembly_type_other, :jsonb 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20210412081144_update_table_block_user_functionality.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20201218144706) 3 | 4 | class UpdateTableBlockUserFunctionality < ActiveRecord::Migration[5.2] 5 | def change 6 | rename_column :decidim_user_suspensions, :suspending_user_id, :blocking_user_id 7 | rename_table :decidim_user_suspensions, :decidim_user_blocks 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20181120111045_add_counter_cache_coauthorships_to_collaborative_drafts.decidim_proposals.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_proposals (originally 20180711074134) 3 | 4 | class AddCounterCacheCoauthorshipsToCollaborativeDrafts < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_proposals_collaborative_drafts, :coauthorships_count, :integer, null: false, default: 0 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20201119110444_create_decidim_term_customizer_translation_sets.decidim_term_customizer.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_term_customizer (originally 20190217132503) 3 | 4 | class CreateDecidimTermCustomizerTranslationSets < ActiveRecord::Migration[5.2] 5 | def change 6 | create_table :decidim_term_customizer_translation_sets do |t| 7 | t.jsonb :name 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20210114102042_close_debates.decidim_debates.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_debates (originally 20200703134657) 3 | 4 | class CloseDebates < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_debates_debates, :closed_at, :datetime 7 | add_column :decidim_debates_debates, :conclusions, :jsonb 8 | add_index :decidim_debates_debates, :closed_at 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20170320140499_add_comments_and_replies_notifications_to_users.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170202084913) 2 | class AddCommentsAndRepliesNotificationsToUsers < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_users, :comments_notifications, :boolean, null: false, default: false 5 | add_column :decidim_users, :replies_notifications, :boolean, null: false, default: false 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180514135731_add_reference_to_sortitions.decidim_sortitions.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_sortitions (originally 20180102101128) 2 | # frozen_string_literal: true 3 | 4 | class AddReferenceToSortitions < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_module_sortitions_sortitions, :reference, :string 7 | change_column_null :decidim_module_sortitions_sortitions, :reference, false 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20181120111029_add_badge_switch_to_organizations.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20181008102144) 3 | 4 | class AddBadgeSwitchToOrganizations < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_organizations, :badges_enabled, :boolean, null: false, default: false 7 | execute "UPDATE decidim_organizations set badges_enabled = true" 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20181120111046_remove_index_counter_cache_coauthorships_to_proposals.decidim_proposals.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_proposals (originally 20180711075004) 3 | 4 | class RemoveIndexCounterCacheCoauthorshipsToProposals < ActiveRecord::Migration[5.2] 5 | def change 6 | remove_index :decidim_proposals_proposals, name: "idx_decidim_proposals_proposals_on_proposal_coauthorships_count" 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170320140476_add_categories.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20161123085134) 2 | class AddCategories < ActiveRecord::Migration[5.0] 3 | def change 4 | create_table :decidim_categories do |t| 5 | t.jsonb :name, null: false 6 | t.jsonb :description, null: false 7 | t.integer :parent_id, index: true 8 | t.integer :decidim_participatory_process_id, index: true 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20210315083951_invalidate_all_sessions_for_deleted_users.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20210302150803) 3 | 4 | class InvalidateAllSessionsForDeletedUsers < ActiveRecord::Migration[5.2] 5 | def up 6 | Decidim::User.reset_column_information 7 | 8 | Decidim::User.where.not(deleted_at: nil).find_each(&:invalidate_all_sessions!) 9 | end 10 | 11 | def down; end 12 | end 13 | -------------------------------------------------------------------------------- /config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /db/migrate/20170320140536_add_answers_to_proposals.decidim_proposals.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_proposals (originally 20170131092413) 2 | class AddAnswersToProposals < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_proposals_proposals, :state, :string, index: true 5 | add_column :decidim_proposals_proposals, :answered_at, :datetime, index: true 6 | add_column :decidim_proposals_proposals, :answer, :jsonb 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170320140542_add_geolocalization_fields_to_proposals.decidim_proposals.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_proposals (originally 20170228105156) 2 | class AddGeolocalizationFieldsToProposals < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_proposals_proposals, :address, :text 5 | add_column :decidim_proposals_proposals, :latitude, :float 6 | add_column :decidim_proposals_proposals, :longitude, :float 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180209123423_add_officialization_to_users.decidim_admin.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_admin (originally 20171219154507) 2 | # frozen_string_literal: true 3 | 4 | class AddOfficializationToUsers < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_users, :officialized_at, :datetime 7 | add_column :decidim_users, :officialized_as, :jsonb 8 | 9 | add_index :decidim_users, :officialized_at 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20181120111024_add_badge_scores.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20180806095628) 3 | 4 | class AddBadgeScores < ActiveRecord::Migration[5.2] 5 | def change 6 | create_table :decidim_gamification_badge_scores do |t| 7 | t.references :user, null: false 8 | t.string :badge_name, null: false 9 | t.integer :value, null: false, default: 0 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20190307141779_reset_negative_children_count_counters.decidim_assemblies.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_assemblies (originally 20190215093700) 3 | 4 | class ResetNegativeChildrenCountCounters < ActiveRecord::Migration[5.2] 5 | def change 6 | ids = Decidim::Assembly.where("children_count < 0").pluck(:id) 7 | ids.each { |id| Decidim::Assembly.reset_counters(id, :children_count) } 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20201019083025_index_foreign_keys_in_decidim_action_logs.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20200320105904) 3 | 4 | class IndexForeignKeysInDecidimActionLogs < ActiveRecord::Migration[5.2] 5 | def change 6 | add_index :decidim_action_logs, :decidim_area_id 7 | add_index :decidim_action_logs, :decidim_scope_id 8 | add_index :decidim_action_logs, :version_id 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20210114102027_drop_proposal_endorsements.decidim_proposals.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_proposals (originally 20200120230130) 3 | 4 | class DropProposalEndorsements < ActiveRecord::Migration[5.2] 5 | def change 6 | drop_table :decidim_proposals_proposal_endorsements, if_exists: true, force: :restrict 7 | remove_column :decidim_proposals_proposals, :proposal_endorsements_count 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20171031144629_add_description_and_progress_to_statuses.decidim_accountability.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_accountability (originally 20170508104902) 2 | # frozen_string_literal: true 3 | 4 | class AddDescriptionAndProgressToStatuses < ActiveRecord::Migration[5.0] 5 | def change 6 | add_column :decidim_accountability_statuses, :description, :jsonb 7 | add_column :decidim_accountability_statuses, :progress, :integer 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20180716091761_remove_authorships_from_proposals.decidim_proposals.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_proposals (originally 20180529110830) 3 | 4 | class RemoveAuthorshipsFromProposals < ActiveRecord::Migration[5.1] 5 | def change 6 | remove_column :decidim_proposals_proposals, :decidim_author_id, :integer 7 | remove_column :decidim_proposals_proposals, :decidim_user_group_id, :integer 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20210412081153_add_promoted_flag_to_decidim_participatory_process_groups.decidim_participatory_processes.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_participatory_processes (originally 20201030133444) 3 | 4 | class AddPromotedFlagToDecidimParticipatoryProcessGroups < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_participatory_process_groups, :promoted, :boolean, default: false, index: true 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170616093817_create_decidim_survey_questions.decidim_surveys.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_surveys (originally 20170515090916) 2 | # frozen_string_literal: true 3 | 4 | class CreateDecidimSurveyQuestions < ActiveRecord::Migration[5.0] 5 | def change 6 | create_table :decidim_surveys_survey_questions do |t| 7 | t.jsonb :body 8 | t.references :decidim_survey, index: true 9 | 10 | t.timestamps 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20180514135740_create_decidim_blogs_posts.decidim_blogs.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_blogs (originally 20171129131353) 2 | # frozen_string_literal: true 3 | 4 | class CreateDecidimBlogsPosts < ActiveRecord::Migration[5.0] 5 | def change 6 | create_table :decidim_blogs_posts do |t| 7 | t.jsonb :title 8 | t.jsonb :body 9 | t.references :decidim_component, index: true 10 | t.timestamps 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20190307141773_add_user_groups_switch_to_organizations.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20181218171503) 3 | 4 | class AddUserGroupsSwitchToOrganizations < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_organizations, :user_groups_enabled, :boolean, null: false, default: false 7 | execute "UPDATE decidim_organizations set user_groups_enabled = true" 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20201019083019_add_rich_text_editor_in_public_views_to_organizations.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20191113144432) 3 | 4 | class AddRichTextEditorInPublicViewsToOrganizations < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_organizations, 7 | :rich_text_editor_in_public_views, 8 | :boolean, 9 | default: false 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20180404082726_create_decidim_area_types.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20180215104821) 2 | # frozen_string_literal: true 3 | 4 | class CreateDecidimAreaTypes < ActiveRecord::Migration[5.1] 5 | def change 6 | create_table :decidim_area_types do |t| 7 | t.references :decidim_organization, foreign_key: true, index: true 8 | t.jsonb :name, null: false 9 | t.jsonb :plural, null: false 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20181120111035_add_cta_url_and_text_to_steps.decidim_participatory_processes.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_participatory_processes (originally 20180926082635) 3 | 4 | class AddCtaUrlAndTextToSteps < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_participatory_process_steps, :cta_text, :jsonb, default: {} 7 | add_column :decidim_participatory_process_steps, :cta_path, :string 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20190307141767_add_columns_to_static_page_topic.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20181119140636) 3 | 4 | class AddColumnsToStaticPageTopic < ActiveRecord::Migration[5.2] 5 | def change 6 | change_table :decidim_static_page_topics do |t| 7 | t.column :weight, :integer, default: nil, null: true 8 | t.column :show_in_footer, :boolean, default: false, null: false 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20170320140537_add_index_to_decidim_proposals_proposals_proposal_votes_count.decidim_proposals.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_proposals (originally 20170205082832) 2 | class AddIndexToDecidimProposalsProposalsProposalVotesCount < ActiveRecord::Migration[5.0] 3 | def change 4 | add_index :decidim_proposals_proposals, :proposal_votes_count 5 | add_index :decidim_proposals_proposals, :created_at 6 | add_index :decidim_proposals_proposals, :state 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20171212150149_add_verification_metadata_to_authorizations.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20171011194251) 2 | # frozen_string_literal: true 3 | 4 | class AddVerificationMetadataToAuthorizations < ActiveRecord::Migration[5.1] 5 | def up 6 | add_column :decidim_authorizations, :verification_metadata, :jsonb, default: {} 7 | end 8 | 9 | def down 10 | remove_column :decidim_authorizations, :verification_metadata 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20180209123432_add_reference_to_debates.decidim_debates.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_debates (originally 20180119150434) 2 | # frozen_string_literal: true 3 | 4 | class AddReferenceToDebates < ActiveRecord::Migration[5.1] 5 | class Debate < ApplicationRecord 6 | self.table_name = :decidim_debates_debates 7 | end 8 | 9 | def change 10 | add_column :decidim_debates_debates, :reference, :string 11 | Debate.find_each(&:save) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20201019083056_add_costs_to_proposals.decidim_proposals.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_proposals (originally 20200210135152) 3 | 4 | class AddCostsToProposals < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_proposals_proposals, :cost, :decimal 7 | add_column :decidim_proposals_proposals, :cost_report, :jsonb 8 | add_column :decidim_proposals_proposals, :execution_period, :jsonb 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20210412081135_create_decidim_user_moderations.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20201010124755) 3 | 4 | class CreateDecidimUserModerations < ActiveRecord::Migration[5.2] 5 | def change 6 | create_table :decidim_user_moderations do |t| 7 | t.belongs_to :decidim_user, foreign_key: true 8 | t.integer :report_count, default: 0, null: false 9 | 10 | t.timestamps 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20170320140484_create_identities.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170116110851) 2 | class CreateIdentities < ActiveRecord::Migration[5.0] 3 | def change 4 | create_table :decidim_identities do |t| 5 | t.string :provider, null: false 6 | t.string :uid, null: false 7 | t.references :decidim_user, null: false, index: true 8 | end 9 | 10 | add_index :decidim_identities, [:provider, :uid], unique: true 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20201019083043_index_foreign_keys_in_decidim_participatory_process_user_roles.decidim_participatory_processes.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_participatory_processes (originally 20200320105924) 3 | 4 | class IndexForeignKeysInDecidimParticipatoryProcessUserRoles < ActiveRecord::Migration[5.2] 5 | def change 6 | add_index :decidim_participatory_process_user_roles, :decidim_user_id, name: "idx_proces_user_role_on_user_id" 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170320140468_add_active_flag_to_step.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20161019072016) 2 | class AddActiveFlagToStep < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_participatory_process_steps, :active, :boolean, default: false 5 | 6 | add_index :decidim_participatory_process_steps, [:decidim_participatory_process_id, :active], unique: true, where: "active = 't'", name: "unique_index_to_avoid_duplicate_active_steps" 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180404082725_fix_reference_for_all_resources.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20180206143340) 2 | # frozen_string_literal: true 3 | 4 | class FixReferenceForAllResources < ActiveRecord::Migration[5.1] 5 | def up 6 | models = ActiveRecord::Base.descendants.select { |c| c.included_modules.include?(Decidim::HasReference) } 7 | 8 | models.each do |model| 9 | model.find_each(&:touch) 10 | end 11 | end 12 | 13 | def down; end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20180615103568_create_decidim_agendas.decidim_meetings.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_meetings (originally 20180419131924) 3 | 4 | class CreateDecidimAgendas < ActiveRecord::Migration[5.1] 5 | def change 6 | create_table :decidim_meetings_agendas do |t| 7 | t.jsonb :title 8 | t.references :decidim_meeting, null: false, index: true 9 | t.boolean :visible 10 | 11 | t.timestamps 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20170915091138_add_start_date_to_processes.decidim_participatory_processes.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_participatory_processes (originally 20170830081725) 2 | # frozen_string_literal: true 3 | 4 | class AddStartDateToProcesses < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_participatory_processes, :start_date, :date 7 | ActiveRecord::Base.connection.execute("UPDATE decidim_participatory_processes SET start_date = created_at") 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20171212150154_create_decidim_receipts.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20171117100533) 2 | # frozen_string_literal: true 3 | 4 | class CreateDecidimReceipts < ActiveRecord::Migration[5.1] 5 | def change 6 | create_table :decidim_messaging_receipts do |t| 7 | t.references :decidim_message, null: false 8 | t.references :decidim_recipient, null: false 9 | t.datetime :read_at 10 | 11 | t.timestamps 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20180514135738_fix_sortitions_feature.decidim_sortitions.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_sortitions (originally 20180322082150) 2 | # frozen_string_literal: true 3 | 4 | class FixSortitionsFeature < ActiveRecord::Migration[5.1] 5 | def up 6 | rename_column :decidim_sortitions_sortitions, :decidim_feature_id, :decidim_component_id 7 | end 8 | 9 | def down 10 | rename_column :decidim_sortitions_sortitions, :decidim_component_id, :decidim_feature_id 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20190307141765_create_decidim_contextual_help_sections.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20181113101935) 3 | 4 | class CreateDecidimContextualHelpSections < ActiveRecord::Migration[5.2] 5 | def change 6 | create_table :decidim_contextual_help_sections do |t| 7 | t.string :section_id, null: false 8 | t.references :organization, null: false 9 | t.jsonb :content, null: false 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20201019083050_create_decidim_assemblies_settings.decidim_assemblies.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_assemblies (originally 20200430202456) 3 | 4 | class CreateDecidimAssembliesSettings < ActiveRecord::Migration[5.2] 5 | def change 6 | create_table :decidim_assemblies_settings do |t| 7 | t.boolean :enable_organization_chart, default: true 8 | t.references :decidim_organization, foreign_key: true 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20210114102044_add_endorsable_to_debates.decidim_debates.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_debates (originally 20200716143929) 3 | 4 | class AddEndorsableToDebates < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_debates_debates, :endorsements_count, :integer, null: false, default: 0 7 | add_index :decidim_debates_debates, :endorsements_count, name: "idx_decidim_debates_debates_on_endorsemnts_count" 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20210412081145_rename_decidim_user_fields_for_block_functionality.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20201218145252) 3 | 4 | class RenameDecidimUserFieldsForBlockFunctionality < ActiveRecord::Migration[5.2] 5 | def change 6 | rename_column :decidim_users, :suspended, :blocked 7 | rename_column :decidim_users, :suspended_at, :blocked_at 8 | rename_column :decidim_users, :suspension_id, :block_id 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20170320140483_create_resource_links.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170113150627) 2 | class CreateResourceLinks < ActiveRecord::Migration[5.0] 3 | def change 4 | create_table :decidim_resource_links do |t| 5 | t.references :from, null: false, polymorphic: true, index: true 6 | t.references :to, null: false, polymorphic: true, index: true 7 | t.string :name, null: false, index: true 8 | t.jsonb :data 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20200221134116_remove_continuity_badges.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20191212102051) 3 | 4 | class RemoveContinuityBadges < ActiveRecord::Migration[5.2] 5 | class BadgeScore < ApplicationRecord 6 | self.table_name = :decidim_gamification_badge_scores 7 | end 8 | 9 | def change 10 | drop_table :decidim_continuity_badge_statuses 11 | 12 | BadgeScore.where(badge_name: :continuity).delete_all 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20170320140472_create_decidim_static_pages.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20161108093802) 2 | class CreateDecidimStaticPages < ActiveRecord::Migration[5.0] 3 | def change 4 | create_table :decidim_static_pages do |t| 5 | t.jsonb :title, null: false 6 | t.string :slug, null: false 7 | t.jsonb :content, null: false 8 | t.references :decidim_organization, foreign_key: true, index: true 9 | t.timestamps 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20171031144627_create_accountability_statuses.decidim_accountability.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_accountability (originally 20170425154712) 2 | # frozen_string_literal: true 3 | 4 | class CreateAccountabilityStatuses < ActiveRecord::Migration[5.0] 5 | def change 6 | create_table :decidim_accountability_statuses do |t| 7 | t.string :key 8 | t.jsonb :name 9 | t.references :decidim_feature, index: true 10 | 11 | t.timestamps 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20181120111019_fix_result_follows.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20180706111847) 3 | 4 | class FixResultFollows < ActiveRecord::Migration[5.2] 5 | def change 6 | # rubocop:disable Rails/SkipsModelValidations 7 | Decidim::Follow.where(decidim_followable_type: "Decidim::Results::Result").update_all(decidim_followable_type: "Decidim::Accountability::Result") 8 | # rubocop:enable Rails/SkipsModelValidations 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20191028080429_add_force_users_to_authenticate_before_access_organization.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20190610093742) 3 | 4 | class AddForceUsersToAuthenticateBeforeAccessOrganization < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_organizations, 7 | :force_users_to_authenticate_before_access_organization, 8 | :boolean, 9 | default: false 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20191028080430_add_confidential_to_doorkeeper_application.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20190618075906) 3 | 4 | class AddConfidentialToDoorkeeperApplication < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column( 7 | :oauth_applications, 8 | :confidential, 9 | :boolean, 10 | null: false, 11 | default: true # maintaining backwards compatibility: require secrets 12 | ) 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20200221134118_add_ip_hash_to_decidim_form_answers.decidim_forms.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_forms (originally 20190930094710) 3 | 4 | class AddIpHashToDecidimFormAnswers < ActiveRecord::Migration[5.2] 5 | class Answer < ApplicationRecord 6 | self.table_name = :decidim_forms_answers 7 | end 8 | 9 | def change 10 | add_column :decidim_forms_answers, :ip_hash, :string 11 | add_index :decidim_forms_answers, :ip_hash 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20201019083036_add_index_on_content_block_scope_id.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20200401073419) 3 | 4 | class AddIndexOnContentBlockScopeId < ActiveRecord::Migration[5.2] 5 | def change 6 | add_index( 7 | :decidim_content_blocks, 8 | [:decidim_organization_id, :scope_name, :scoped_resource_id, :manifest_name], 9 | name: "idx_decidim_content_blocks_org_id_scope_scope_id_manifest" 10 | ) 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20210114102023_create_meeting_services_table.decidim_meetings.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_meetings (originally 20200702123209) 3 | 4 | class CreateMeetingServicesTable < ActiveRecord::Migration[5.2] 5 | def change 6 | create_table :decidim_meetings_services do |t| 7 | t.jsonb :title 8 | t.jsonb :description 9 | t.bigint :decidim_meeting_id, null: false, index: true 10 | 11 | t.timestamps 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20181120111021_create_decidim_hashtags.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20180726112510) 3 | 4 | class CreateDecidimHashtags < ActiveRecord::Migration[5.2] 5 | def self.up 6 | create_table :decidim_hashtags do |t| 7 | t.references :decidim_organization 8 | 9 | t.string :name, index: true 10 | 11 | t.timestamps 12 | end 13 | end 14 | 15 | def self.down 16 | drop_table :decidim_hashtags 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /db/migrate/20170320140495_add_extra_info_to_processes.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170126151123) 2 | class AddExtraInfoToProcesses < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_participatory_processes, :domain, :jsonb 5 | add_column :decidim_participatory_processes, :end_date, :date 6 | add_column :decidim_participatory_processes, :developer_group, :string 7 | add_column :decidim_participatory_processes, :scope, :jsonb 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20210114102048_add_commentable_counter_cache_to_posts.decidim_blogs.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_blogs (originally 20200827153709) 3 | 4 | class AddCommentableCounterCacheToPosts < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_blogs_posts, :comments_count, :integer, null: false, default: 0, index: true 7 | Decidim::Blogs::Post.reset_column_information 8 | Decidim::Blogs::Post.find_each(&:update_comments_count) 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20170320140503_add_social_media_handlers_to_organization.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170207091021) 2 | class AddSocialMediaHandlersToOrganization < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_organizations, :instagram_handler, :string 5 | add_column :decidim_organizations, :facebook_handler, :string 6 | add_column :decidim_organizations, :youtube_handler, :string 7 | add_column :decidim_organizations, :github_handler, :string 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20180404082727_create_decidim_areas.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20180215104945) 2 | # frozen_string_literal: true 3 | 4 | class CreateDecidimAreas < ActiveRecord::Migration[5.1] 5 | def change 6 | create_table :decidim_areas do |t| 7 | t.jsonb :name 8 | t.references :area_type, foreign_key: { to_table: :decidim_area_types }, index: true 9 | t.references :decidim_organization, foreign_key: true, index: true 10 | t.timestamps 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20190307141777_create_decidim_forms_answer_options.decidim_forms.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_forms (originally 20180405015012) 3 | 4 | class CreateDecidimFormsAnswerOptions < ActiveRecord::Migration[5.1] 5 | def change 6 | create_table :decidim_forms_answer_options do |t| 7 | t.references :decidim_question, index: { name: "index_decidim_forms_answer_options_question_id" } 8 | t.jsonb :body 9 | t.boolean :free_text 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20201019083039_add_matrix_row_id_to_decidim_forms_answer_choices.decidim_forms.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_forms (originally 20200304152939) 3 | 4 | class AddMatrixRowIdToDecidimFormsAnswerChoices < ActiveRecord::Migration[5.2] 5 | class AnswerChoice < ApplicationRecord 6 | self.table_name = :decidim_forms_answer_choices 7 | end 8 | 9 | def change 10 | add_column :decidim_forms_answer_choices, :decidim_question_matrix_row_id, :integer 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20170616093816_create_decidim_surveys.decidim_surveys.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_surveys (originally 20170511092231) 2 | # frozen_string_literal: true 3 | 4 | class CreateDecidimSurveys < ActiveRecord::Migration[5.0] 5 | def change 6 | create_table :decidim_surveys_surveys do |t| 7 | t.jsonb :title 8 | t.jsonb :description 9 | t.jsonb :tos 10 | t.references :decidim_feature, index: true 11 | t.datetime :published_at 12 | 13 | t.timestamps 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/migrate/20210114102025_add_commentable_counter_cache_to_meetings.decidim_meetings.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_meetings (originally 20200827153856) 3 | 4 | class AddCommentableCounterCacheToMeetings < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_meetings_meetings, :comments_count, :integer, null: false, default: 0 7 | Decidim::Meetings::Meeting.reset_column_information 8 | Decidim::Meetings::Meeting.find_each(&:update_comments_count) 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20210114102040_add_commentable_counter_cache_to_projects.decidim_budgets.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_budgets (originally 20200827154129) 3 | 4 | class AddCommentableCounterCacheToProjects < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_budgets_projects, :comments_count, :integer, null: false, default: 0, index: true 7 | Decidim::Budgets::Project.reset_column_information 8 | Decidim::Budgets::Project.find_each(&:update_comments_count) 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20170320140506_add_organization_custom_reference.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170215115407) 2 | class AddOrganizationCustomReference < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_organizations, :reference_prefix, :string 5 | 6 | Decidim::Organization.find_each do |organization| 7 | organization.update_attribute(:reference_prefix, organization.name[0]) 8 | end 9 | 10 | change_column_null :decidim_organizations, :reference_prefix, false 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20170616093808_set_email_unique_in_organization_conditional.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170606102659) 2 | # frozen_string_literal: true 3 | 4 | class SetEmailUniqueInOrganizationConditional < ActiveRecord::Migration[5.0] 5 | def change 6 | remove_index :decidim_users, %w(email decidim_organization_id) 7 | add_index :decidim_users, %w(email decidim_organization_id), where: "(deleted_at IS NULL)", name: "index_decidim_users_on_email_and_decidim_organization_id", unique: true 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20180615103567_create_meetings_minutes.decidim_meetings.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_meetings (originally 20180406080619) 3 | 4 | class CreateMeetingsMinutes < ActiveRecord::Migration[5.1] 5 | def change 6 | create_table :decidim_meetings_minutes do |t| 7 | t.references :decidim_meeting, index: true 8 | t.jsonb :description 9 | t.string :video_url 10 | t.string :audio_url 11 | t.boolean :visible 12 | 13 | t.timestamps 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/migrate/20210114102021_add_commentable_counter_cache_to_comments.decidim_comments.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_comments (originally 20200828101910) 3 | 4 | class AddCommentableCounterCacheToComments < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_comments_comments, :comments_count, :integer, null: false, default: 0, index: true 7 | Decidim::Comments::Comment.reset_column_information 8 | Decidim::Comments::Comment.find_each(&:update_comments_count) 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = '1.0' 5 | 6 | # Add additional assets to the asset load path 7 | # Rails.application.config.assets.paths << Emoji.images_path 8 | 9 | # Precompile additional assets. 10 | # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. 11 | # Rails.application.config.assets.precompile += %w( search.js ) 12 | -------------------------------------------------------------------------------- /config/puma.rb: -------------------------------------------------------------------------------- 1 | workers Integer(ENV['WEB_CONCURRENCY'] || 2) 2 | threads_count = Integer(ENV['RAILS_MAX_THREADS'] || 5) 3 | threads threads_count, threads_count 4 | 5 | preload_app! 6 | 7 | rackup DefaultRackup 8 | port ENV['PORT'] || 3000 9 | environment ENV['RACK_ENV'] || 'development' 10 | 11 | on_worker_boot do 12 | # Worker specific setup for Rails 4.1+ 13 | # See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot 14 | ActiveRecord::Base.establish_connection 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20180514135734_add_cancel_data_to_sortition.decidim_sortitions.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_sortitions (originally 20180103160301) 2 | # frozen_string_literal: true 3 | 4 | class AddCancelDataToSortition < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_module_sortitions_sortitions, :cancel_reason, :jsonb 7 | add_column :decidim_module_sortitions_sortitions, :cancelled_on, :datetime 8 | add_column :decidim_module_sortitions_sortitions, :cancelled_by_user_id, :integer, index: true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20181120111052_add_organization_as_author.decidim_proposals.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_proposals (originally 20181016132225) 3 | 4 | class AddOrganizationAsAuthor < ActiveRecord::Migration[5.2] 5 | def change 6 | official_proposals = Decidim::Proposals::Proposal.find_each.select do |proposal| 7 | proposal.coauthorships.count.zero? 8 | end 9 | 10 | official_proposals.each do |proposal| 11 | proposal.add_coauthor(proposal.organization) 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /app/views/census_authorization/_form.html.erb: -------------------------------------------------------------------------------- 1 |
2 | <%= form.select :document_type, handler.census_document_types, prompt: true %> 3 |
4 | 5 |
6 | <%= form.text_field :document_number %> 7 |
8 | 9 |
10 | <%= form.date_select :date_of_birth, start_year: 1900, end_year: 15.years.ago.year, default: 35.years.ago, prompt: { day: t(".date_select.day"), month: t(".date_select.month"), year: t(".date_select.year") } %> 11 |
12 | 13 | <%= form.hidden_field :handler_name %> 14 | -------------------------------------------------------------------------------- /db/migrate/20170320140513_add_available_authorizations_to_organization.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170313095436) 2 | class AddAvailableAuthorizationsToOrganization < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_organizations, :available_authorizations, :string, array: true, default: [] 5 | 6 | handlers = Decidim.authorization_handlers.map(&:name) 7 | Decidim::Organization.find_each do |org| 8 | org.update_attributes(available_authorizations: handlers) 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20170320140549_create_line_items.decidim_budgets.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_budgets (originally 20170130101825) 2 | class CreateLineItems < ActiveRecord::Migration[5.0] 3 | def change 4 | create_table :decidim_budgets_line_items do |t| 5 | t.references :decidim_order, index: true 6 | t.references :decidim_project, index: true 7 | end 8 | 9 | add_index :decidim_budgets_line_items, [:decidim_order_id, :decidim_project_id], unique: true, name: "decidim_budgets_line_items_order_project_unique" 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20180514135739_fix_sortitions_proposal_feature.decidim_sortitions.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_sortitions (originally 20180322085145) 2 | # frozen_string_literal: true 3 | 4 | class FixSortitionsProposalFeature < ActiveRecord::Migration[5.1] 5 | def up 6 | rename_column :decidim_sortitions_sortitions, :decidim_proposals_feature_id, :decidim_proposals_component_id 7 | end 8 | 9 | def down 10 | rename_column :decidim_sortitions_sortitions, :decidim_proposals_component_id, :decidim_proposals_feature_id 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20170320140467_create_decidim_authorizations.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20161018091013) 2 | class CreateDecidimAuthorizations < ActiveRecord::Migration[5.0] 3 | def change 4 | create_table :decidim_authorizations do |t| 5 | t.string :name, null: false 6 | t.jsonb :metadata 7 | t.references :decidim_user, null: false, foreign_key: true, index: true 8 | 9 | t.timestamps 10 | end 11 | 12 | add_index :decidim_authorizations, [:decidim_user_id, :name], unique: true 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20170829072057_create_impersonation_logs.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170724130558) 2 | # frozen_string_literal: true 3 | 4 | class CreateImpersonationLogs < ActiveRecord::Migration[5.1] 5 | def change 6 | create_table :decidim_impersonation_logs do |t| 7 | t.references :decidim_admin, index: true 8 | t.references :decidim_user, index: true 9 | t.datetime :started_at 10 | t.datetime :ended_at 11 | t.datetime :expired_at 12 | 13 | t.timestamps 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/migrate/20180716091759_add_counter_cache_coauthorships_to_proposals.decidim_proposals.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_proposals (originally 20180529101323) 3 | 4 | class AddCounterCacheCoauthorshipsToProposals < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_proposals_proposals, :coauthorships_count, :integer, null: false, default: 0 7 | add_index :decidim_proposals_proposals, :coauthorships_count, name: "idx_decidim_proposals_proposals_on_proposal_coauthorships_count" 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20201019083038_create_decidim_forms_question_matrix_rows.decidim_forms.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_forms (originally 20200225123810) 3 | 4 | class CreateDecidimFormsQuestionMatrixRows < ActiveRecord::Migration[5.2] 5 | def change 6 | create_table :decidim_forms_question_matrix_rows do |t| 7 | t.references :decidim_question, index: { name: "index_decidim_forms_question_matrix_questionnaire_id" } 8 | t.integer :position, index: true 9 | t.jsonb :body 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20170320140544_create_results.decidim_results.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_results (originally 20170116104125) 2 | class CreateResults < ActiveRecord::Migration[5.0] 3 | def change 4 | create_table :decidim_results_results do |t| 5 | t.jsonb :title 6 | t.jsonb :description 7 | t.jsonb :short_description 8 | t.references :decidim_feature, index: true 9 | t.references :decidim_scope, index: true 10 | t.references :decidim_category, index: true 11 | 12 | t.timestamps 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20181120111016_create_decidim_resource_permissions.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20180705091019) 3 | 4 | class CreateDecidimResourcePermissions < ActiveRecord::Migration[5.2] 5 | def change 6 | create_table :decidim_resource_permissions do |t| 7 | t.belongs_to :resource, polymorphic: true, index: { name: "index_decidim_resource_permissions_on_r_type_and_r_id", unique: true } 8 | t.jsonb :permissions, default: {} 9 | 10 | t.timestamps 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20210114102047_add_commentable_counter_cache_to_sortitions.decidim_sortitions.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_sortitions (originally 20200827154036) 3 | 4 | class AddCommentableCounterCacheToSortitions < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_sortitions_sortitions, :comments_count, :integer, null: false, default: 0, index: true 7 | Decidim::Sortitions::Sortition.reset_column_information 8 | Decidim::Sortitions::Sortition.find_each(&:update_comments_count) 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180404082738_add_counter_cache_endorsements_to_proposals.decidim_proposals.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_proposals (originally 20171201122623) 2 | # frozen_string_literal: true 3 | 4 | class AddCounterCacheEndorsementsToProposals < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_proposals_proposals, :proposal_endorsements_count, :integer, null: false, default: 0 7 | add_index :decidim_proposals_proposals, :proposal_endorsements_count, name: "idx_decidim_proposals_proposals_on_proposal_endorsemnts_count" 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20181120111018_add_nickname_to_managed_users.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20180706104107) 3 | 4 | class AddNicknameToManagedUsers < ActiveRecord::Migration[5.2] 5 | class User < ApplicationRecord 6 | self.table_name = :decidim_users 7 | end 8 | 9 | def up 10 | User.where(managed: true, nickname: nil).includes(:organization).find_each do |user| 11 | user.nickname = User.nicknamize(user.name, organization: user.organization) 12 | user.save 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20181120111047_create_participatory_texts.decidim_proposals.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_proposals (originally 20180927111721) 3 | 4 | class CreateParticipatoryTexts < ActiveRecord::Migration[5.2] 5 | def change 6 | create_table :decidim_proposals_participatory_texts do |t| 7 | t.jsonb :title 8 | t.jsonb :description 9 | t.belongs_to :decidim_component, null: false, index: { name: "idx_participatory_texts_on_decidim_component_id" } 10 | 11 | t.timestamps 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20190613081741_create_decidim_verifications_csv_data.decidim_verifications.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_verifications (originally 20181227135423) 3 | 4 | class CreateDecidimVerificationsCsvData < ActiveRecord::Migration[5.2] 5 | def change 6 | create_table :decidim_verifications_csv_data do |t| 7 | t.string :email 8 | t.references :decidim_organization, foreign_key: true, index: { name: "index_verifications_csv_census_to_organization" } 9 | 10 | t.timestamps 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20210114102041_add_commentable_counter_cache_to_results.decidim_accountability.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_accountability (originally 20200827154103) 3 | 4 | class AddCommentableCounterCacheToResults < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_accountability_results, :comments_count, :integer, null: false, default: 0, index: true 7 | Decidim::Accountability::Result.reset_column_information 8 | Decidim::Accountability::Result.find_each(&:update_comments_count) 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /db/migrate/20190307141761_add_static_page_topics.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20181023104416) 3 | 4 | class AddStaticPageTopics < ActiveRecord::Migration[5.2] 5 | def change 6 | create_table :decidim_static_page_topics do |t| 7 | t.column :title, :jsonb, null: false 8 | t.column :description, :jsonb, null: false 9 | t.references :organization, null: false 10 | end 11 | 12 | change_table :decidim_static_pages do |t| 13 | t.references :topic 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # README 2 | 3 | [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy) 4 | 5 | This README would normally document whatever steps are necessary to get the 6 | application up and running. 7 | 8 | Things you may want to cover: 9 | 10 | * Ruby version 11 | 12 | * System dependencies 13 | 14 | * Configuration 15 | 16 | * Database creation 17 | 18 | * Database initialization 19 | 20 | * How to run the test suite 21 | 22 | * Services (job queues, cache servers, search engines, etc.) 23 | 24 | * Deployment instructions 25 | 26 | * ... 27 | -------------------------------------------------------------------------------- /bin/spring: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # This file loads spring without using Bundler, in order to be fast. 4 | # It gets overwritten when you run the `spring binstub` command. 5 | 6 | unless defined?(Spring) 7 | require 'rubygems' 8 | require 'bundler' 9 | 10 | lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read) 11 | spring = lockfile.specs.detect { |spec| spec.name == "spring" } 12 | if spring 13 | Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path 14 | gem 'spring', spring.version 15 | require 'spring/binstub' 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /db/migrate/20170320140516_change_user_groups_verified_to_timestamp.decidim_admin.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_admin (originally 20170128112958) 2 | class ChangeUserGroupsVerifiedToTimestamp < ActiveRecord::Migration[5.0] 3 | def change 4 | ActiveRecord::Base.transaction do 5 | add_column :decidim_user_groups, :verified_at, :datetime 6 | ActiveRecord::Base.connection.execute("UPDATE decidim_user_groups SET verified_at = '#{Time.current.to_s(:db)}' WHERE verified = 't'") 7 | remove_column :decidim_user_groups, :verified 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20170616093811_create_decidim_categorizations.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170612100253) 2 | # frozen_string_literal: true 3 | 4 | class CreateDecidimCategorizations < ActiveRecord::Migration[5.1] 5 | def change 6 | create_table :decidim_categorizations do |t| 7 | t.references :decidim_category, foreign_key: true, null: false 8 | t.references :categorizable, polymorphic: true, null: false, index: { name: "decidim_categorizations_categorizable_id_and_type" } 9 | 10 | t.timestamps 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20170915091131_create_decidim_notifications.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170808071019) 2 | # frozen_string_literal: true 3 | 4 | class CreateDecidimNotifications < ActiveRecord::Migration[5.1] 5 | def change 6 | create_table :decidim_notifications do |t| 7 | t.references :decidim_user, null: false 8 | t.references :decidim_resource, polymorphic: true, index: false, null: false 9 | t.string :event_name, null: false 10 | t.string :event_class, null: false 11 | t.timestamps 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20210114102032_create_decidim_budgets.decidim_budgets.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_budgets (originally 20200617105120) 3 | 4 | class CreateDecidimBudgets < ActiveRecord::Migration[5.0] 5 | def change 6 | create_table :decidim_budgets_budgets do |t| 7 | t.jsonb :title 8 | t.integer :weight, null: false, default: 0 9 | t.jsonb :description 10 | t.integer :total_budget, default: 0 11 | t.references :decidim_component, index: true 12 | 13 | t.timestamps 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/migrate/20170320140469_add_position_to_steps.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20161020080756) 2 | class AddPositionToSteps < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_participatory_process_steps, :position, :integer, null: false 5 | add_index :decidim_participatory_process_steps, :position, order: { position: :asc }, name: "index_order_by_position_for_steps" 6 | add_index :decidim_participatory_process_steps, [:decidim_participatory_process_id, :position], unique: true, name: "index_unique_position_for_process" 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170320140505_create_decidim_newsletters.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170213081133) 2 | class CreateDecidimNewsletters < ActiveRecord::Migration[5.0] 3 | def change 4 | create_table :decidim_newsletters do |t| 5 | t.jsonb :subject 6 | t.jsonb :body 7 | t.references :organization 8 | t.references :author, foreign_key: { to_table: :decidim_users } 9 | t.integer :total_recipients 10 | t.integer :total_deliveries 11 | t.datetime :sent_at 12 | 13 | t.timestamps 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/migrate/20170915091139_add_registration_attributes_to_meetings.decidim_meetings.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_meetings (originally 20170810120836) 2 | # frozen_string_literal: true 3 | 4 | class AddRegistrationAttributesToMeetings < ActiveRecord::Migration[5.1] 5 | def change 6 | add_column :decidim_meetings_meetings, :registrations_enabled, :boolean, null: false, default: false 7 | add_column :decidim_meetings_meetings, :available_slots, :integer, null: false, default: 0 8 | add_column :decidim_meetings_meetings, :registration_terms, :jsonb 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /app/controllers/decidim_controller.rb: -------------------------------------------------------------------------------- 1 | # Entry point for Decidim. It will use the `DecidimController` as 2 | # entry point, but you can change what controller it inherits from 3 | # so you can customize some methods. 4 | class DecidimController < ApplicationController 5 | before_action :set_raven_context 6 | 7 | private 8 | 9 | def set_raven_context 10 | return unless Rails.application.secrets.sentry_enabled? 11 | Raven.user_context({id: try(:current_user).try(:id)}.merge(session)) 12 | Raven.extra_context(params: params.to_unsafe_h, url: request.url) 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20210412081138_create_decidim_user_suspensions.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20201011074641) 3 | 4 | class CreateDecidimUserSuspensions < ActiveRecord::Migration[5.2] 5 | def change 6 | create_table :decidim_user_suspensions do |t| 7 | t.belongs_to :decidim_user, foreign_key: true 8 | t.integer :suspending_user_id 9 | t.text :justification 10 | 11 | t.timestamps 12 | end 13 | add_foreign_key :decidim_user_suspensions, :decidim_users, column: :suspending_user_id 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20201019083044_index_foreign_keys_in_decidim_participatory_processes.decidim_participatory_processes.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_participatory_processes (originally 20200320105925) 3 | 4 | class IndexForeignKeysInDecidimParticipatoryProcesses < ActiveRecord::Migration[5.2] 5 | def change 6 | add_index :decidim_participatory_processes, :decidim_participatory_process_group_id, name: "idx_process_on_process_group_id" 7 | add_index :decidim_participatory_processes, :decidim_scope_id, name: "idx_process_on_scope_id" 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | app: 4 | build: 5 | context: . 6 | args: 7 | rails_env: development 8 | volumes: 9 | - .:/code 10 | environment: 11 | - DATABASE_HOST=pg 12 | - DATABASE_USERNAME=postgres 13 | ports: 14 | - 3000:3000 15 | links: 16 | - pg 17 | - redis 18 | pg: 19 | image: postgres 20 | volumes: 21 | - pg-data:/var/lib/postgresql/data 22 | redis: 23 | image: redis 24 | volumes: 25 | - redis-data:/data 26 | volumes: 27 | pg-data: {} 28 | redis-data: {} 29 | -------------------------------------------------------------------------------- /db/migrate/20170320140527_close_a_meeting.decidim_meetings.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_meetings (originally 20170110142105) 2 | class CloseAMeeting < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :decidim_meetings_meetings, :closing_report, :jsonb 5 | add_column :decidim_meetings_meetings, :attendees_count, :integer 6 | add_column :decidim_meetings_meetings, :contributions_count, :integer 7 | add_column :decidim_meetings_meetings, :attending_organizations, :text 8 | add_column :decidim_meetings_meetings, :closed_at, :time, index: true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20170320140548_create_orders.decidim_budgets.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_budgets (originally 20170130095615) 2 | class CreateOrders < ActiveRecord::Migration[5.0] 3 | def change 4 | create_table :decidim_budgets_orders do |t| 5 | t.references :decidim_user, index: true 6 | t.references :decidim_feature, index: true 7 | t.datetime :checked_out_at 8 | 9 | t.timestamps 10 | end 11 | 12 | add_index :decidim_budgets_orders, [:decidim_user_id, :decidim_feature_id], unique: true, name: "decidim_budgets_order_user_feature_unique" 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20180615103569_create_decidim_agenda_items.decidim_meetings.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_meetings (originally 20180419132104) 3 | 4 | class CreateDecidimAgendaItems < ActiveRecord::Migration[5.1] 5 | def change 6 | create_table :decidim_meetings_agenda_items do |t| 7 | t.references :decidim_agenda, index: true 8 | t.integer :position 9 | t.references :parent, index: true 10 | t.integer :duration 11 | t.jsonb :title 12 | t.jsonb :description 13 | 14 | t.timestamps 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /db/migrate/20181120111030_create_decidim_continuity_badge_statuses.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20181010044613) 3 | 4 | class CreateDecidimContinuityBadgeStatuses < ActiveRecord::Migration[5.2] 5 | def change 6 | create_table :decidim_continuity_badge_statuses do |t| 7 | t.integer :current_streak, :integer, null: false, default: 0 8 | t.date :last_session_at, null: false 9 | t.references :subject, null: false, polymorphic: true, index: { name: "decidim_continuity_statuses_subject" } 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20190307141772_add_notification_types_to_users.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20181214101250) 3 | 4 | class AddNotificationTypesToUsers < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_users, :notification_types, :string, default: "all" 7 | # rubocop:disable Rails/SkipsModelValidations 8 | Decidim::UserBaseEntity.update_all(notification_types: "all") 9 | # rubocop:enable Rails/SkipsModelValidations 10 | 11 | change_column_null :decidim_users, :notification_types, false 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20200221134114_add_lockable_to_users.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20191028135718) 3 | 4 | class AddLockableToUsers < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_users, :failed_attempts, :integer, default: 0, null: false # Only if lock strategy is :failed_attempts 7 | add_column :decidim_users, :unlock_token, :string # Only if unlock strategy is :email or :both 8 | add_column :decidim_users, :locked_at, :datetime 9 | add_index :decidim_users, :unlock_token, unique: true 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20170320140547_create_projects.decidim_budgets.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_budgets (originally 20170127114122) 2 | class CreateProjects < ActiveRecord::Migration[5.0] 3 | def change 4 | create_table :decidim_budgets_projects do |t| 5 | t.jsonb :title 6 | t.jsonb :description 7 | t.jsonb :short_description 8 | t.integer :budget, null: false 9 | t.references :decidim_feature, index: true 10 | t.references :decidim_scope, index: true 11 | t.references :decidim_category, index: true 12 | 13 | t.timestamps 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/migrate/20180514135733_drop_decidim_category_id_from_sortitions.decidim_sortitions.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_sortitions (originally 20180103123055) 2 | # frozen_string_literal: true 3 | 4 | class DropDecidimCategoryIdFromSortitions < ActiveRecord::Migration[5.1] 5 | def up 6 | remove_column :decidim_module_sortitions_sortitions, :decidim_category_id 7 | end 8 | 9 | def down 10 | add_reference :decidim_module_sortitions_sortitions, :decidim_category, 11 | foreign_key: true, 12 | index: { name: "index_sortitions__on_category" } 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20190307141763_add_welcome_notification.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20181029121244) 3 | 4 | class AddWelcomeNotification < ActiveRecord::Migration[5.2] 5 | def change 6 | change_table :decidim_organizations do |t| 7 | t.boolean :send_welcome_notification, null: false, default: false 8 | t.jsonb :welcome_notification_subject, null: true 9 | t.jsonb :welcome_notification_body, null: true 10 | end 11 | 12 | execute "UPDATE decidim_organizations SET send_welcome_notification = 'true'" 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20190307141766_add_following_and_followers_counters_to_users.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20181115102958) 3 | 4 | class AddFollowingAndFollowersCountersToUsers < ActiveRecord::Migration[5.2] 5 | def up 6 | add_column :decidim_users, :following_count, :integer, null: false, default: 0 7 | add_column :decidim_users, :followers_count, :integer, null: false, default: 0 8 | end 9 | 10 | def down 11 | remove_column :decidim_users, :following_count 12 | remove_column :decidim_users, :followers_count 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20181120111039_create_decidim_meetings_invites.decidim_meetings.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_meetings (originally 20180607142020) 3 | 4 | class CreateDecidimMeetingsInvites < ActiveRecord::Migration[5.2] 5 | def change 6 | create_table :decidim_meetings_invites do |t| 7 | t.references :decidim_user, null: false, index: true 8 | t.references :decidim_meeting, null: false, index: true 9 | t.datetime :sent_at 10 | t.datetime :accepted_at 11 | t.datetime :rejected_at 12 | 13 | t.timestamps 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/migrate/20201019083024_add_direct_message_types_to_users.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20200211173227) 3 | 4 | class AddDirectMessageTypesToUsers < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_users, :direct_message_types, :string, default: "all" 7 | # rubocop:disable Rails/SkipsModelValidations 8 | Decidim::UserBaseEntity.update_all(direct_message_types: "all") 9 | # rubocop:enable Rails/SkipsModelValidations 10 | 11 | change_column_null :decidim_users, :direct_message_types, false 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20201019083059_publish_existing_proposals_state.decidim_proposals.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_proposals (originally 20200306123652) 3 | 4 | class PublishExistingProposalsState < ActiveRecord::Migration[5.2] 5 | def up 6 | execute <<-SQL.squish 7 | UPDATE decidim_proposals_proposals SET state_published_at = COALESCE(answered_at, published_at) WHERE state IS NOT NULL 8 | SQL 9 | end 10 | 11 | def down 12 | execute <<-SQL.squish 13 | UPDATE decidim_proposals_proposals SET state_published_at = NULL 14 | SQL 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile '~/.gitignore_global' 6 | 7 | # Ignore bundler config. 8 | /.bundle 9 | 10 | # Ignore all logfiles and tempfiles. 11 | /log/* 12 | /tmp/* 13 | !/log/.keep 14 | !/tmp/.keep 15 | 16 | # Ignore Byebug command history file. 17 | .byebug_history 18 | 19 | # Ignore public uploads 20 | public/uploads 21 | 22 | .rspec-failures -------------------------------------------------------------------------------- /db/migrate/20170320140531_create_decidim_proposals.decidim_proposals.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_proposals (originally 20161212110850) 2 | class CreateDecidimProposals < ActiveRecord::Migration[5.0] 3 | def change 4 | create_table :decidim_proposals_proposals do |t| 5 | t.text :title, null: false 6 | t.text :body, null: false 7 | t.references :decidim_feature, index: true, null: false 8 | t.references :decidim_author, index: true 9 | t.references :decidim_category, index: true 10 | t.references :decidim_scope, index: true 11 | 12 | t.timestamps 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20170616093818_create_decidim_survey_answers.decidim_surveys.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_surveys (originally 20170515144119) 2 | # frozen_string_literal: true 3 | 4 | class CreateDecidimSurveyAnswers < ActiveRecord::Migration[5.0] 5 | def change 6 | create_table :decidim_surveys_survey_answers do |t| 7 | t.jsonb :body, default: [] 8 | t.references :decidim_user, index: true 9 | t.references :decidim_survey, index: true 10 | t.references :decidim_survey_question, index: { name: "index_decidim_surveys_answers_question_id" } 11 | 12 | t.timestamps 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20171031144630_create_accountability_timeline_entries.decidim_accountability.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_accountability (originally 20170620154712) 2 | # frozen_string_literal: true 3 | 4 | class CreateAccountabilityTimelineEntries < ActiveRecord::Migration[5.0] 5 | def change 6 | create_table :decidim_accountability_timeline_entries do |t| 7 | t.date :entry_date, index: true 8 | t.jsonb :description 9 | t.references :decidim_accountability_result, index: { name: :index_decidim_accountability_timeline_entries_on_results_id } 10 | 11 | t.timestamps 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20190307141775_create_decidim_forms_questions.decidim_forms.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_forms (originally 20170515090916) 3 | 4 | class CreateDecidimFormsQuestions < ActiveRecord::Migration[5.0] 5 | def change 6 | create_table :decidim_forms_questions do |t| 7 | t.references :decidim_questionnaire, index: true 8 | t.integer :position, index: true 9 | t.string :question_type 10 | t.boolean :mandatory 11 | t.jsonb :body 12 | t.jsonb :description 13 | t.integer :max_choices 14 | 15 | t.timestamps 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /db/migrate/20170320140488_create_user_group_memberships.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170119150255) 2 | class CreateUserGroupMemberships < ActiveRecord::Migration[5.0] 3 | def change 4 | create_table :decidim_user_group_memberships do |t| 5 | t.references :decidim_user, null: false, index: true 6 | t.references :decidim_user_group, null: false, index: true 7 | 8 | t.timestamps 9 | end 10 | 11 | add_index :decidim_user_group_memberships, [:decidim_user_id, :decidim_user_group_id], unique: true, name: "decidim_user_group_memberships_unique_user_and_group_ids" 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20180209123429_create_debates.decidim_debates.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_debates (originally 20170118141619) 2 | # frozen_string_literal: true 3 | 4 | class CreateDebates < ActiveRecord::Migration[5.0] 5 | def change 6 | create_table :decidim_debates_debates do |t| 7 | t.jsonb :title 8 | t.jsonb :description 9 | t.jsonb :instructions 10 | t.datetime :start_time 11 | t.datetime :end_time 12 | t.string :image 13 | t.references :decidim_feature, index: true 14 | t.references :decidim_category, index: true 15 | 16 | t.timestamps 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /db/migrate/20180404082723_create_decidim_attachment_collections.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20171207182729) 2 | # frozen_string_literal: true 3 | 4 | class CreateDecidimAttachmentCollections < ActiveRecord::Migration[5.1] 5 | def change 6 | create_table :decidim_attachment_collections do |t| 7 | t.jsonb :name, null: false 8 | t.jsonb :description, null: false 9 | t.integer :weight, null: false, default: 0 10 | t.references :collection_for, polymorphic: true, null: false, index: { name: "decidim_attachment_collections_collection_for_id_and_type" } 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20190307141774_create_decidim_forms_questionnaires.decidim_forms.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_forms (originally 20170511092231) 3 | 4 | class CreateDecidimFormsQuestionnaires < ActiveRecord::Migration[5.0] 5 | def change 6 | create_table :decidim_forms_questionnaires do |t| 7 | t.jsonb :title 8 | t.jsonb :description 9 | t.jsonb :tos 10 | t.references :questionnaire_for, polymorphic: true, index: { name: "index_decidim_forms_questionnaires_questionnaire_for" } 11 | t.datetime :published_at 12 | 13 | t.timestamps 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) 7 | # Character.create(name: 'Luke', movie: movies.first) 8 | 9 | # You can remove the 'faker' gem if you don't want Decidim seeds. 10 | if ENV["HEROKU_APP_NAME"].present? 11 | ENV["DECIDIM_HOST"] = ENV["HEROKU_APP_NAME"] + ".herokuapp.com" 12 | ENV["SEED"] = "true" 13 | end 14 | 15 | Decidim.seed! -------------------------------------------------------------------------------- /db/migrate/20190307141776_create_decidim_forms_answers.decidim_forms.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_forms (originally 20170515144119) 3 | 4 | class CreateDecidimFormsAnswers < ActiveRecord::Migration[5.0] 5 | def change 6 | create_table :decidim_forms_answers do |t| 7 | t.jsonb :body, default: [] 8 | t.references :decidim_user, index: true 9 | t.references :decidim_questionnaire, index: true 10 | t.references :decidim_question, index: { name: "index_decidim_forms_answers_question_id" } 11 | t.text :body 12 | 13 | t.timestamps 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/migrate/20190307141781_add_questionnaire_to_existing_meetings.decidim_meetings.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_meetings (originally 20181107175558) 3 | 4 | class AddQuestionnaireToExistingMeetings < ActiveRecord::Migration[5.2] 5 | def change 6 | Decidim::Meetings::Meeting.transaction do 7 | Decidim::Meetings::Meeting.find_each do |meeting| 8 | if meeting.component.present? && meeting.questionnaire.blank? 9 | meeting.update!( 10 | questionnaire: Decidim::Forms::Questionnaire.new 11 | ) 12 | end 13 | end 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/migrate/20210218074154_add_salt_to_decidim_forms_questionnaires.decidim_forms.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_forms (originally 20201110152921) 3 | 4 | class AddSaltToDecidimFormsQuestionnaires < ActiveRecord::Migration[5.2] 5 | class Questionnaire < ApplicationRecord 6 | self.table_name = :decidim_forms_questionnaires 7 | end 8 | 9 | def change 10 | add_column :decidim_forms_questionnaires, :salt, :string 11 | 12 | Questionnaire.find_each do |questionnaire| 13 | questionnaire.salt = Decidim::Tokenizer.random_salt 14 | questionnaire.save! 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /db/migrate/20180514135709_rename_features_to_components_at_pages.decidim_pages.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_pages (originally 20180305133658) 2 | # frozen_string_literal: true 3 | 4 | class RenameFeaturesToComponentsAtPages < ActiveRecord::Migration[5.1] 5 | def change 6 | rename_column :decidim_pages_pages, :decidim_feature_id, :decidim_component_id 7 | 8 | if index_name_exists?(:decidim_pages_pages, "index_decidim_pages_pages_on_decidim_feature_id") 9 | rename_index :decidim_pages_pages, "index_decidim_pages_pages_on_decidim_feature_id", "index_decidim_pages_pages_on_decidim_component_id" 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20170320140521_create_comments.decidim_comments.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_comments (originally 20161130143508) 2 | class CreateComments < ActiveRecord::Migration[5.0] 3 | def change 4 | create_table :decidim_comments_comments do |t| 5 | t.text :body, null: false 6 | t.references :decidim_commentable, null: false, polymorphic: true, index: { name: "decidim_comments_comment_commentable" } 7 | t.references :decidim_author, null: false, index: { name: "decidim_comments_comment_author" } 8 | 9 | t.timestamps 10 | end 11 | 12 | add_index :decidim_comments_comments, :created_at 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20180404082740_add_published_at_to_proposals.decidim_proposals.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_proposals (originally 20171220084719) 2 | # frozen_string_literal: true 3 | 4 | class AddPublishedAtToProposals < ActiveRecord::Migration[5.1] 5 | def up 6 | add_column :decidim_proposals_proposals, :published_at, :datetime, index: true 7 | # rubocop:disable Rails/SkipsModelValidations 8 | Decidim::Proposals::Proposal.update_all("published_at = updated_at") 9 | # rubocop:enable Rails/SkipsModelValidations 10 | end 11 | 12 | def down 13 | remove_column :decidim_proposals_proposals, :published_at 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20180716091757_create_coauthorships.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20180427141253) 3 | 4 | class CreateCoauthorships < ActiveRecord::Migration[5.1] 5 | def change 6 | create_table :decidim_coauthorships do |t| 7 | t.references :decidim_author, null: false, index: { name: "index_author_on_coauthorsihp" } 8 | t.references :decidim_user_group, index: { name: "index_user_group_on_coauthorsihp" } 9 | t.references :coauthorable, polymorphic: true, index: { name: "index_coauthorable_on_coauthorship" } 10 | 11 | t.timestamps 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20190307141762_add_timestamps_to_components.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20181025082245) 3 | 4 | class AddTimestampsToComponents < ActiveRecord::Migration[5.2] 5 | def change 6 | add_timestamps :decidim_components, null: true 7 | # rubocop:disable Rails/SkipsModelValidations 8 | Decidim::Component.update_all(created_at: Time.current, updated_at: Time.current) 9 | # rubocop:enable Rails/SkipsModelValidations 10 | change_column_null :decidim_components, :created_at, false 11 | change_column_null :decidim_components, :updated_at, false 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20170829072056_set_email_unique_in_organization_condition_for_managed_users.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170720140610) 2 | # frozen_string_literal: true 3 | 4 | class SetEmailUniqueInOrganizationConditionForManagedUsers < ActiveRecord::Migration[5.1] 5 | def change 6 | remove_index :decidim_users, %w(email decidim_organization_id) 7 | add_index :decidim_users, 8 | %w(email decidim_organization_id), 9 | where: "(deleted_at IS NULL) AND (managed = 'f')", 10 | name: "index_decidim_users_on_email_and_decidim_organization_id", 11 | unique: true 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20170915091140_create_registrations.decidim_meetings.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_meetings (originally 20170810131100) 2 | # frozen_string_literal: true 3 | 4 | class CreateRegistrations < ActiveRecord::Migration[5.1] 5 | def change 6 | create_table :decidim_meetings_registrations do |t| 7 | t.references :decidim_user, null: false, index: true 8 | t.references :decidim_meeting, null: false, index: true 9 | 10 | t.timestamps 11 | end 12 | 13 | add_index :decidim_meetings_registrations, [:decidim_user_id, :decidim_meeting_id], unique: true, name: "decidim_meetings_registrations_user_meeting_unique" 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20171212150153_add_object_changes_to_versions.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20171107103254) 2 | # frozen_string_literal: true 3 | 4 | # This migration adds the optional `object_changes` column, in which PaperTrail 5 | # will store the `changes` diff for each update event. See the readme for 6 | # details. 7 | class AddObjectChangesToVersions < ActiveRecord::Migration[5.1] 8 | # The largest text column available in all supported RDBMS. 9 | # See `create_versions.rb` for details. 10 | TEXT_BYTES = 1_073_741_823 11 | 12 | def change 13 | add_column :versions, :object_changes, :text, limit: TEXT_BYTES 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20190307141778_create_decidim_forms_answer_choices.decidim_forms.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_forms (originally 20180405015147) 3 | 4 | class CreateDecidimFormsAnswerChoices < ActiveRecord::Migration[5.1] 5 | def change 6 | create_table :decidim_forms_answer_choices do |t| 7 | t.references :decidim_answer, index: { name: "index_decidim_forms_answer_choices_answer_id" } 8 | t.references :decidim_answer_option, index: { name: "index_decidim_forms_answer_choices_answer_option_id" } 9 | t.integer :position 10 | t.jsonb :body 11 | t.text :custom_body 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20210412081147_add_followable_counter_cache_to_users.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20210310120640) 3 | 4 | class AddFollowableCounterCacheToUsers < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_users, :follows_count, :integer, null: false, default: 0, index: true 7 | 8 | reversible do |dir| 9 | dir.up do 10 | Decidim::User.reset_column_information 11 | Decidim::User.find_each do |record| 12 | p record.id 13 | record.class.reset_counters(record.id, :follows) 14 | end 15 | end 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /db/migrate/20210412081162_fix_answered_proposals_after_copy.decidim_proposals.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_proposals (originally 20210127115628) 3 | 4 | class FixAnsweredProposalsAfterCopy < ActiveRecord::Migration[5.2] 5 | def change 6 | proposals_after_copy = Decidim::ResourceLink.where(from_type: "Decidim::Proposals::Proposal").pluck(:from_id) 7 | 8 | result = Decidim::Proposals::Proposal.where.not(state_published_at: nil).where(state: nil, id: proposals_after_copy) 9 | 10 | result.find_each do |proposal| 11 | proposal.state_published_at = nil 12 | proposal.save! 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20170405124721_change_decidim_identities_provider_uid_index_uniqueness.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170405094258) 2 | class ChangeDecidimIdentitiesProviderUidIndexUniqueness < ActiveRecord::Migration[5.0] 3 | def change 4 | remove_index :decidim_identities, [:provider, :uid] 5 | add_index :decidim_identities, [:provider, :uid, :decidim_organization_id], unique: true, 6 | name: "decidim_identities_provider_uid_organization_unique" 7 | 8 | Decidim::Identity.includes(:user).find_each do |identity| 9 | identity.organization = identity.user.organization 10 | identity.save! 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20201019083055_add_proposal_valuation_assignments.decidim_proposals.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_proposals (originally 20200203111239) 3 | 4 | class AddProposalValuationAssignments < ActiveRecord::Migration[5.2] 5 | def change 6 | create_table :decidim_proposals_valuation_assignments do |t| 7 | t.references :decidim_proposal, null: false, index: { name: "decidim_proposals_valuation_assignment_proposal" } 8 | t.references :valuator_role, polymorphic: true, null: false, index: { name: "decidim_proposals_valuation_assignment_valuator_role" } 9 | 10 | t.timestamps 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20210412081171_add_followable_counter_cache_to_blogs.decidim_blogs.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_blogs (originally 20210310120514) 3 | 4 | class AddFollowableCounterCacheToBlogs < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_blogs_posts, :follows_count, :integer, null: false, default: 0, index: true 7 | 8 | reversible do |dir| 9 | dir.up do 10 | Decidim::Blogs::Post.reset_column_information 11 | Decidim::Blogs::Post.find_each do |record| 12 | record.class.reset_counters(record.id, :follows) 13 | end 14 | end 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /db/migrate/20170320140509_add_participatory_process_groups.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170228142440) 2 | class AddParticipatoryProcessGroups < ActiveRecord::Migration[5.0] 3 | def change 4 | create_table :decidim_participatory_process_groups do |t| 5 | t.jsonb :name, null: false 6 | t.jsonb :description, null: false 7 | t.string :hero_image 8 | 9 | t.references :decidim_organization, index: { name: "decidim_participatory_process_group_organization" } 10 | 11 | t.timestamps 12 | end 13 | 14 | add_column :decidim_participatory_processes, :decidim_participatory_process_group_id, :integer 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/migrate/20180514135716_rename_features_to_components_at_surveys.decidim_surveys.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_surveys (originally 20180305133837) 2 | # frozen_string_literal: true 3 | 4 | class RenameFeaturesToComponentsAtSurveys < ActiveRecord::Migration[5.1] 5 | def change 6 | rename_column :decidim_surveys_surveys, :decidim_feature_id, :decidim_component_id 7 | 8 | if index_name_exists?(:decidim_surveys_surveys, "index_decidim_surveys_surveys_on_decidim_feature_id") 9 | rename_index :decidim_surveys_surveys, "index_decidim_surveys_surveys_on_decidim_feature_id", "index_decidim_surveys_surveys_on_decidim_component_id" 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20180514135726_rename_features_to_components_at_debates.decidim_debates.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_debates (originally 20180305133556) 2 | # frozen_string_literal: true 3 | 4 | class RenameFeaturesToComponentsAtDebates < ActiveRecord::Migration[5.1] 5 | def change 6 | rename_column :decidim_debates_debates, :decidim_feature_id, :decidim_component_id 7 | 8 | if index_name_exists?(:decidim_debates_debates, "index_decidim_debates_debates_on_decidim_feature_id") 9 | rename_index :decidim_debates_debates, "index_decidim_debates_debates_on_decidim_feature_id", "index_decidim_debates_debates_on_decidim_component_id" 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20210412081157_add_followable_counter_cache_to_assemblies.decidim_assemblies.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_assemblies (originally 20210310120444) 3 | 4 | class AddFollowableCounterCacheToAssemblies < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_assemblies, :follows_count, :integer, null: false, default: 0, index: true 7 | 8 | reversible do |dir| 9 | dir.up do 10 | Decidim::Assembly.reset_column_information 11 | Decidim::Assembly.find_each do |record| 12 | record.class.reset_counters(record.id, :follows) 13 | end 14 | end 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /db/migrate/20181120111054_fix_user_groups_ids_on_debates.decidim_debates.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_debates (originally 20181003081235) 3 | 4 | class FixUserGroupsIdsOnDebates < ActiveRecord::Migration[5.2] 5 | # rubocop:disable Rails/SkipsModelValidations 6 | def change 7 | Decidim::UserGroup.find_each do |group| 8 | old_id = group.extended_data["old_user_group_id"] 9 | next unless old_id 10 | 11 | Decidim::Debates::Debate 12 | .where(decidim_user_group_id: old_id) 13 | .update_all(decidim_user_group_id: group.id) 14 | end 15 | end 16 | # rubocop:enable Rails/SkipsModelValidations 17 | end 18 | -------------------------------------------------------------------------------- /db/migrate/20180209123426_add_assembly_user_roles.decidim_assemblies.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_assemblies (originally 20180109105917) 2 | # frozen_string_literal: true 3 | 4 | class AddAssemblyUserRoles < ActiveRecord::Migration[5.1] 5 | def change 6 | create_table :decidim_assembly_user_roles do |t| 7 | t.integer :decidim_user_id 8 | t.integer :decidim_assembly_id 9 | t.string :role 10 | t.timestamps 11 | end 12 | 13 | add_index :decidim_assembly_user_roles, 14 | [:decidim_assembly_id, :decidim_user_id, :role], 15 | unique: true, 16 | name: "index_unique_user_and_assembly_role" 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /db/migrate/20181120111036_fix_user_groups_ids_in_comments.decidim_comments.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_comments (originally 20181003080320) 3 | 4 | class FixUserGroupsIdsInComments < ActiveRecord::Migration[5.2] 5 | # rubocop:disable Rails/SkipsModelValidations 6 | def change 7 | Decidim::UserGroup.find_each do |group| 8 | old_id = group.extended_data["old_user_group_id"] 9 | next unless old_id 10 | 11 | Decidim::Comments::Comment 12 | .where(decidim_user_group_id: old_id) 13 | .update_all(decidim_user_group_id: group.id) 14 | end 15 | end 16 | # rubocop:enable Rails/SkipsModelValidations 17 | end 18 | -------------------------------------------------------------------------------- /db/migrate/20210412081136_create_decidim_user_reports.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20201010124756) 3 | 4 | class CreateDecidimUserReports < ActiveRecord::Migration[5.2] 5 | def change 6 | create_table :decidim_user_reports do |t| 7 | t.integer :user_moderation_id, foreign_key: true 8 | t.integer :user_id, null: false 9 | t.string :reason 10 | t.text :details 11 | 12 | t.timestamps 13 | end 14 | add_foreign_key :decidim_user_reports, :decidim_user_moderations, column: :user_moderation_id 15 | add_foreign_key :decidim_user_reports, :decidim_users, column: :user_id 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /db/migrate/20210412081166_add_followable_counter_cache_to_budgets.decidim_budgets.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_budgets (originally 20210310120613) 3 | 4 | class AddFollowableCounterCacheToBudgets < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_budgets_projects, :follows_count, :integer, null: false, default: 0, index: true 7 | 8 | reversible do |dir| 9 | dir.up do 10 | Decidim::Budgets::Project.reset_column_information 11 | Decidim::Budgets::Project.find_each do |record| 12 | record.class.reset_counters(record.id, :follows) 13 | end 14 | end 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /db/migrate/20210412081170_add_followable_counter_cache_to_debates.decidim_debates.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim_debates (originally 20210310120652) 3 | 4 | class AddFollowableCounterCacheToDebates < ActiveRecord::Migration[5.2] 5 | def change 6 | add_column :decidim_debates_debates, :follows_count, :integer, null: false, default: 0, index: true 7 | 8 | reversible do |dir| 9 | dir.up do 10 | Decidim::Debates::Debate.reset_column_information 11 | Decidim::Debates::Debate.find_each do |record| 12 | record.class.reset_counters(record.id, :follows) 13 | end 14 | end 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /db/migrate/20170320140511_create_reports.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20170307084957) 2 | class CreateReports < ActiveRecord::Migration[5.0] 3 | def change 4 | create_table :decidim_reports do |t| 5 | t.references :decidim_moderation, null: false, index: { name: "decidim_reports_moderation" } 6 | t.references :decidim_user, null: false, index: { name: "decidim_reports_user" } 7 | 8 | t.string :reason, null: false 9 | t.text :details 10 | 11 | t.timestamps 12 | end 13 | 14 | add_index :decidim_reports, [:decidim_moderation_id, :decidim_user_id], unique: true, name: "decidim_reports_moderation_user_unique" 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/migrate/20171212150152_create_versions.decidim.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim (originally 20171107103253) 2 | # frozen_string_literal: true 3 | 4 | # This migration creates the `versions` table, the only schema PT requires. 5 | # All other migrations PT provides are optional. 6 | class CreateVersions < ActiveRecord::Migration[5.1] 7 | def change 8 | create_table :versions do |t| 9 | t.string :item_type, null: false 10 | t.integer :item_id, null: false 11 | t.string :event, null: false 12 | t.string :whodunnit 13 | t.jsonb :object 14 | 15 | t.datetime :created_at 16 | end 17 | add_index :versions, [:item_type, :item_id] 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /db/migrate/20180514135710_rename_features_to_components_at_meetings.decidim_meetings.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from decidim_meetings (originally 20180305133634) 2 | # frozen_string_literal: true 3 | 4 | class RenameFeaturesToComponentsAtMeetings < ActiveRecord::Migration[5.1] 5 | def change 6 | rename_column :decidim_meetings_meetings, :decidim_feature_id, :decidim_component_id 7 | 8 | if index_name_exists?(:decidim_meetings_meetings, "index_decidim_meetings_meetings_on_decidim_feature_id") 9 | rename_index :decidim_meetings_meetings, "index_decidim_meetings_meetings_on_decidim_feature_id", "index_decidim_meetings_meetings_on_decidim_component_id" 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20190705112622_add_missing_indexes.decidim.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # This migration comes from decidim (originally 20190412105836) 3 | 4 | class AddMissingIndexes < ActiveRecord::Migration[5.2] 5 | def change 6 | add_index :decidim_follows, [:decidim_followable_id, :decidim_followable_type], name: "index_follows_followable_id_and_type" 7 | add_index :decidim_user_group_memberships, [:decidim_user_group_id, :decidim_user_id], name: "index_user_group_memberships_group_id_user_id" 8 | add_index :decidim_users, [:id, :type] 9 | add_index :decidim_users, [:invited_by_id, :invited_by_type] 10 | add_index :versions, [:item_id, :item_type] 11 | end 12 | end 13 | --------------------------------------------------------------------------------