Skip to content

Commit

Permalink
Update decidim awesome migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
Kagemaru committed Feb 22, 2024
1 parent 57db12c commit 2556aca
Show file tree
Hide file tree
Showing 6 changed files with 177 additions and 76 deletions.
6 changes: 6 additions & 0 deletions app/views/static/api/docs/object/proposal/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,12 @@ <h2>
<div class="description-wrapper">
<p>The total amount of votes the proposal has received</p>
</div>
</div>
<div class="field-entry ">
<span id="voteweights" class="field-name anchored">voteWeights (<code><a href="/api/docs/scalar/json">JSON</a></code>)</span>
<div class="description-wrapper">
<p>The corresponding weights count to the proposal votes</p>
</div>
</div></div>
<div id="sidebar"><ul class="categories">
<li>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 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
19 changes: 18 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2024_02_21_121735) do
ActiveRecord::Schema.define(version: 2024_02_22_103255) do

# These are extensions that must be enabled in order to support this database
enable_extension "ltree"
Expand Down Expand Up @@ -323,6 +323,23 @@
t.index ["decidim_organization_id"], name: "decidim_awesome_editor_images_constraint_organization"
end

create_table "decidim_awesome_proposal_extra_fields", force: :cascade do |t|
t.bigint "decidim_proposal_id", null: false
t.jsonb "vote_weight_totals"
t.integer "weight_total", default: 0
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["decidim_proposal_id"], name: "decidim_awesome_extra_fields_on_proposal"
end

create_table "decidim_awesome_vote_weights", force: :cascade do |t|
t.bigint "proposal_vote_id", null: false
t.integer "weight", default: 1, null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["proposal_vote_id"], name: "decidim_awesome_proposals_weights_vote"
end

create_table "decidim_blogs_posts", id: :serial, force: :cascade do |t|
t.jsonb "title"
t.jsonb "body"
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@decidim/core": "^0.27.5",
"@decidim/elections": "^0.27.5",
"@decidim/webpacker": "^0.27.5",
"@geoman-io/leaflet-geoman-free": "^2.13.0",
"@geoman-io/leaflet-geoman-free": "^2.16.0",
"codemirror": "^5.65.13",
"esri-leaflet": "^2.5.0",
"europa": "^4.0.0",
Expand All @@ -19,7 +19,7 @@
"jquery-form": "^4.3.0",
"jquery-ui": "^1.13.2",
"jsrender": "^1.0.13",
"jsviews": "^1.0.11",
"jsviews": "^1.0.13",
"leaflet": "^1.8.0",
"leaflet-svgicon": "^0.0.2",
"leaflet-tilelayer-swiss": "^2.2.1",
Expand Down Expand Up @@ -51,9 +51,9 @@
"@decidim/eslint-config": "^0.27.5",
"@decidim/stylelint-config": "^0.27.5",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.8.0",
"eslint-config-prettier": "^8.10.0",
"eslint-config-standard": "^11.0.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-standard": "^3.1.0",
"sass-embedded": "~1.57.1",
"stylelint": "^13.11.0"
Expand Down
Loading

0 comments on commit 2556aca

Please sign in to comment.