Remove poll votation types

Unfortunately this feature wasn't properly reviewed and tested, and it
had many bugs, some of them critical and hard to fix, like validations
being skipped in concurrent requests.

So we're removing it before releasing version 1.1. We might add it back
in the future if we manage to solve the critical issues.

This commit reverts commit 836f9ba7.
This commit is contained in:
Javi Martín
2019-10-30 18:48:55 +01:00
parent f3df3f4fbc
commit af7c37634d
53 changed files with 173 additions and 2244 deletions

View File

@@ -0,0 +1,11 @@
class DropVotationTypes < ActiveRecord::Migration[5.0]
def up
drop_table :votation_set_answers
drop_table :poll_pair_answers
drop_table :votation_types
end
def down
fail ActiveRecord::IrreversibleMigration
end
end

View File

@@ -0,0 +1,9 @@
class RemoveOrderPositiveAndValueFromPollAnswers < ActiveRecord::Migration[5.0]
def change
remove_column :poll_answers, :value, :integer
remove_column :poll_answers, :positive, :boolean
remove_column :poll_answers, :order, :integer
remove_column :poll_question_answers, :hidden, :boolean, default: false
end
end

View File

@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20191030011956) do
ActiveRecord::Schema.define(version: 20191030160347) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -1039,9 +1039,6 @@ ActiveRecord::Schema.define(version: 20191030011956) do
t.string "answer"
t.datetime "created_at"
t.datetime "updated_at"
t.boolean "positive"
t.integer "order"
t.integer "value"
t.index ["author_id"], name: "index_poll_answers_on_author_id", using: :btree
t.index ["question_id", "answer"], name: "index_poll_answers_on_question_id_and_answer", using: :btree
t.index ["question_id"], name: "index_poll_answers_on_question_id", using: :btree
@@ -1097,19 +1094,6 @@ ActiveRecord::Schema.define(version: 20191030011956) do
t.index ["user_id"], name: "index_poll_officers_on_user_id", using: :btree
end
create_table "poll_pair_answers", force: :cascade do |t|
t.integer "question_id"
t.integer "author_id"
t.integer "answer_right_id"
t.integer "answer_left_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["answer_left_id"], name: "index_poll_pair_answers_on_answer_left_id", using: :btree
t.index ["answer_right_id"], name: "index_poll_pair_answers_on_answer_right_id", using: :btree
t.index ["author_id"], name: "index_poll_pair_answers_on_author_id", using: :btree
t.index ["question_id"], name: "index_poll_pair_answers_on_question_id", using: :btree
end
create_table "poll_partial_results", force: :cascade do |t|
t.integer "question_id"
t.integer "author_id"
@@ -1153,7 +1137,6 @@ ActiveRecord::Schema.define(version: 20191030011956) do
t.integer "question_id"
t.integer "given_order", default: 1
t.boolean "most_voted", default: false
t.boolean "hidden", default: false
t.index ["question_id"], name: "index_poll_question_answers_on_question_id", using: :btree
end
@@ -1670,29 +1653,6 @@ ActiveRecord::Schema.define(version: 20191030011956) do
t.index ["user_id"], name: "index_visits_on_user_id", using: :btree
end
create_table "votation_set_answers", force: :cascade do |t|
t.integer "author_id"
t.integer "votation_type_id"
t.string "answer"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["author_id"], name: "index_votation_set_answers_on_author_id", using: :btree
t.index ["votation_type_id"], name: "index_votation_set_answers_on_votation_type_id", using: :btree
end
create_table "votation_types", force: :cascade do |t|
t.integer "questionable_id"
t.string "questionable_type"
t.integer "enum_type"
t.boolean "open_answer"
t.boolean "prioritized"
t.integer "prioritization_type"
t.integer "max_votes"
t.integer "max_groups_answers"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "votes", force: :cascade do |t|
t.string "votable_type"
t.integer "votable_id"
@@ -1801,5 +1761,4 @@ ActiveRecord::Schema.define(version: 20191030011956) do
add_foreign_key "trackers", "users"
add_foreign_key "users", "geozones"
add_foreign_key "valuators", "users"
add_foreign_key "votation_set_answers", "votation_types"
end