Added results_enabled and stats_enabled to Poll

This commit is contained in:
María Checa
2017-10-20 18:44:56 +02:00
parent 3daf957813
commit 9fc35e9087
2 changed files with 55 additions and 7 deletions

View File

@@ -0,0 +1,6 @@
class AddResultsAndStatsToPolls < ActiveRecord::Migration
def change
add_column :polls, :results_enabled, :boolean, default: false
add_column :polls, :stats_enabled, :boolean, default: false
end
end

View File

@@ -11,7 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20171017221546) do ActiveRecord::Schema.define(version: 20171020163240) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
@@ -486,6 +486,10 @@ ActiveRecord::Schema.define(version: 20171017221546) do
t.boolean "draft_publication_enabled", default: false t.boolean "draft_publication_enabled", default: false
t.boolean "result_publication_enabled", default: false t.boolean "result_publication_enabled", default: false
t.boolean "published", default: true t.boolean "published", default: true
t.date "proposals_phase_start_date"
t.date "proposals_phase_end_date"
t.boolean "proposals_phase_enabled"
t.text "proposals_description"
end end
add_index "legislation_processes", ["allegations_end_date"], name: "index_legislation_processes_on_allegations_end_date", using: :btree add_index "legislation_processes", ["allegations_end_date"], name: "index_legislation_processes_on_allegations_end_date", using: :btree
@@ -498,6 +502,36 @@ ActiveRecord::Schema.define(version: 20171017221546) do
add_index "legislation_processes", ["result_publication_date"], name: "index_legislation_processes_on_result_publication_date", using: :btree add_index "legislation_processes", ["result_publication_date"], name: "index_legislation_processes_on_result_publication_date", using: :btree
add_index "legislation_processes", ["start_date"], name: "index_legislation_processes_on_start_date", using: :btree add_index "legislation_processes", ["start_date"], name: "index_legislation_processes_on_start_date", using: :btree
create_table "legislation_proposals", force: :cascade do |t|
t.integer "legislation_process_id"
t.string "title", limit: 80
t.text "description"
t.string "question"
t.string "external_url"
t.integer "author_id"
t.datetime "hidden_at"
t.integer "flags_count", default: 0
t.datetime "ignored_flag_at"
t.integer "cached_votes_up", default: 0
t.integer "comments_count", default: 0
t.datetime "confirmed_hide_at"
t.integer "hot_score", limit: 8, default: 0
t.integer "confidence_score", default: 0
t.string "responsible_name", limit: 60
t.text "summary"
t.string "video_url"
t.tsvector "tsv"
t.integer "geozone_id"
t.datetime "retired_at"
t.string "retired_reason"
t.text "retired_explanation"
t.integer "community_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
add_index "legislation_proposals", ["legislation_process_id"], name: "index_legislation_proposals_on_legislation_process_id", using: :btree
create_table "legislation_question_options", force: :cascade do |t| create_table "legislation_question_options", force: :cascade do |t|
t.integer "legislation_question_id" t.integer "legislation_question_id"
t.string "value" t.string "value"
@@ -666,6 +700,7 @@ ActiveRecord::Schema.define(version: 20171017221546) do
t.text "description" t.text "description"
t.integer "question_id" t.integer "question_id"
t.integer "given_order", default: 1 t.integer "given_order", default: 1
t.boolean "most_voted", default: false
end end
add_index "poll_question_answers", ["question_id"], name: "index_poll_question_answers_on_question_id", using: :btree add_index "poll_question_answers", ["question_id"], name: "index_poll_question_answers_on_question_id", using: :btree
@@ -759,6 +794,8 @@ ActiveRecord::Schema.define(version: 20171017221546) do
t.integer "comments_count", default: 0 t.integer "comments_count", default: 0
t.integer "author_id" t.integer "author_id"
t.datetime "hidden_at" t.datetime "hidden_at"
t.boolean "results_enabled", default: false
t.boolean "stats_enabled", default: false
end end
add_index "polls", ["starts_at", "ends_at"], name: "index_polls_on_starts_at_and_ends_at", using: :btree add_index "polls", ["starts_at", "ends_at"], name: "index_polls_on_starts_at_and_ends_at", using: :btree
@@ -918,16 +955,20 @@ ActiveRecord::Schema.define(version: 20171017221546) do
add_index "taggings", ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context", using: :btree add_index "taggings", ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context", using: :btree
create_table "tags", force: :cascade do |t| create_table "tags", force: :cascade do |t|
t.string "name", limit: 40 t.string "name", limit: 40
t.integer "taggings_count", default: 0 t.integer "taggings_count", default: 0
t.integer "debates_count", default: 0 t.integer "debates_count", default: 0
t.integer "proposals_count", default: 0 t.integer "proposals_count", default: 0
t.integer "spending_proposals_count", default: 0 t.integer "spending_proposals_count", default: 0
t.string "kind" t.string "kind"
t.integer "budget/investments_count", default: 0 t.integer "budget/investments_count", default: 0
t.integer "legislation/proposals_count", default: 0
t.integer "legislation/processes_count", default: 0
end end
add_index "tags", ["debates_count"], name: "index_tags_on_debates_count", using: :btree add_index "tags", ["debates_count"], name: "index_tags_on_debates_count", using: :btree
add_index "tags", ["legislation/processes_count"], name: "index_tags_on_legislation/processes_count", using: :btree
add_index "tags", ["legislation/proposals_count"], name: "index_tags_on_legislation/proposals_count", using: :btree
add_index "tags", ["name"], name: "index_tags_on_name", unique: true, using: :btree add_index "tags", ["name"], name: "index_tags_on_name", unique: true, using: :btree
add_index "tags", ["proposals_count"], name: "index_tags_on_proposals_count", using: :btree add_index "tags", ["proposals_count"], name: "index_tags_on_proposals_count", using: :btree
add_index "tags", ["spending_proposals_count"], name: "index_tags_on_spending_proposals_count", using: :btree add_index "tags", ["spending_proposals_count"], name: "index_tags_on_spending_proposals_count", using: :btree
@@ -1105,6 +1146,7 @@ ActiveRecord::Schema.define(version: 20171017221546) do
add_foreign_key "identities", "users" add_foreign_key "identities", "users"
add_foreign_key "images", "users" add_foreign_key "images", "users"
add_foreign_key "legislation_draft_versions", "legislation_processes" add_foreign_key "legislation_draft_versions", "legislation_processes"
add_foreign_key "legislation_proposals", "legislation_processes"
add_foreign_key "locks", "users" add_foreign_key "locks", "users"
add_foreign_key "managers", "users" add_foreign_key "managers", "users"
add_foreign_key "moderators", "users" add_foreign_key "moderators", "users"