From 8b111e9f6e20dde05b3da2912f7960639dda2fa5 Mon Sep 17 00:00:00 2001 From: quentinchampenois <26109239+Quentinchampenois@users.noreply.github.com> Date: Wed, 3 Jan 2024 18:17:04 +0100 Subject: [PATCH] fix: Bump homepage proposals and custom proposal states --- Gemfile.lock | 4 ++-- ...ult_value_for_decidim_endorsements.decidim.rb | 13 +++++++++++++ ...esome_vote_weights.decidim_decidim_awesome.rb | 15 +++++++++++++++ ...posal_extra_fields.decidim_decidim_awesome.rb | 16 ++++++++++++++++ 4 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20240103110734_change_default_value_for_decidim_endorsements.decidim.rb create mode 100644 db/migrate/20240103110735_create_decidim_awesome_vote_weights.decidim_decidim_awesome.rb create mode 100644 db/migrate/20240103110736_create_decidim_awesome_proposal_extra_fields.decidim_decidim_awesome.rb diff --git a/Gemfile.lock b/Gemfile.lock index 731cfe7..e96ba25 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -44,7 +44,7 @@ GIT GIT remote: https://github.com/alecslupu-pfa/decidim-module-custom_proposal_states - revision: 92b02c1ed2311547b9b4688d16411b4d9be99af6 + revision: 5a01dcd0c61f7760adb929d53a6ccdbe6af5b050 branch: chore/fix-module-dependency specs: decidim-custom_proposal_states (0.26.8) @@ -62,7 +62,7 @@ GIT GIT remote: https://github.com/alecslupu-pfa/decidim-module_homepage_proposals - revision: 498631e9a5c2fa1628b25c6d6fecbedd8fc507f9 + revision: 1e5753b2db6caaba5b38c7de7865de8cf22c11db branch: feature/reset-filters specs: decidim-homepage_proposals (1.0.2) diff --git a/db/migrate/20240103110734_change_default_value_for_decidim_endorsements.decidim.rb b/db/migrate/20240103110734_change_default_value_for_decidim_endorsements.decidim.rb new file mode 100644 index 0000000..be91c9d --- /dev/null +++ b/db/migrate/20240103110734_change_default_value_for_decidim_endorsements.decidim.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +# This migration comes from decidim (originally 20231027142329) + +class ChangeDefaultValueForDecidimEndorsements < ActiveRecord::Migration[6.0] + def up + change_column_default :decidim_endorsements, :decidim_user_group_id, 0 + end + + def down + change_column_default :decidim_endorsements, :decidim_user_group_id, nil + end +end diff --git a/db/migrate/20240103110735_create_decidim_awesome_vote_weights.decidim_decidim_awesome.rb b/db/migrate/20240103110735_create_decidim_awesome_vote_weights.decidim_decidim_awesome.rb new file mode 100644 index 0000000..e23875c --- /dev/null +++ b/db/migrate/20240103110735_create_decidim_awesome_vote_weights.decidim_decidim_awesome.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +# This migration comes from decidim_decidim_awesome (originally 20231006113837) + +class CreateDecidimAwesomeVoteWeights < ActiveRecord::Migration[6.0] + def change + create_table :decidim_awesome_vote_weights do |t| + # this might be polymorphic in the future (if other types of votes are supported) + t.references :proposal_vote, null: false, index: { name: "decidim_awesome_proposals_weights_vote" } + + t.integer :weight, null: false, default: 1 + t.timestamps + end + end +end diff --git a/db/migrate/20240103110736_create_decidim_awesome_proposal_extra_fields.decidim_decidim_awesome.rb b/db/migrate/20240103110736_create_decidim_awesome_proposal_extra_fields.decidim_decidim_awesome.rb new file mode 100644 index 0000000..76a1d2e --- /dev/null +++ b/db/migrate/20240103110736_create_decidim_awesome_proposal_extra_fields.decidim_decidim_awesome.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +# This migration comes from decidim_decidim_awesome (originally 20231006113841) + +class CreateDecidimAwesomeProposalExtraFields < ActiveRecord::Migration[6.0] + def change + create_table :decidim_awesome_proposal_extra_fields do |t| + # this might be polymorphic in the future (if other types of votes are supported) + t.references :decidim_proposal, null: false, index: { name: "decidim_awesome_extra_fields_on_proposal" } + + t.jsonb :vote_weight_totals + t.integer :weight_total, default: 0 + t.timestamps + end + end +end