Remove Poll Recount model and all usages

This commit is contained in:
Bertocq
2017-07-19 19:47:31 +02:00
parent d98425f45b
commit 361e0efe00
19 changed files with 47 additions and 264 deletions

View File

@@ -576,19 +576,6 @@ print "Creating Poll Officer Assignments"
end
end
puts ""
print "Creating Poll Recounts" do
(1..15).to_a.sample.times do |i|
poll_officer.poll_officer.officer_assignments.all.sample(i).each do |officer_assignment|
Poll::Recount.create(officer_assignment: officer_assignment,
booth_assignment: officer_assignment.booth_assignment,
date: officer_assignment.date,
count: (1..5000).to_a.sample)
end
end
end
puts ""
print "Creating Poll Questions from Proposals"

View File

@@ -0,0 +1,8 @@
class RemovePollRecount < ActiveRecord::Migration
def change
remove_index :poll_recounts, column: [:booth_assignment_id]
remove_index :poll_recounts, column: [:officer_assignment_id]
drop_table :poll_recounts
end
end

View File

@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170713110317) do
ActiveRecord::Schema.define(version: 20170719174326) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -652,20 +652,6 @@ ActiveRecord::Schema.define(version: 20170713110317) do
add_index "poll_questions", ["proposal_id"], name: "index_poll_questions_on_proposal_id", using: :btree
add_index "poll_questions", ["tsv"], name: "index_poll_questions_on_tsv", using: :gin
create_table "poll_recounts", force: :cascade do |t|
t.integer "booth_assignment_id"
t.integer "officer_assignment_id"
t.integer "count"
t.text "count_log", default: ""
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.date "date", null: false
t.text "officer_assignment_id_log", default: ""
end
add_index "poll_recounts", ["booth_assignment_id"], name: "index_poll_recounts_on_booth_assignment_id", using: :btree
add_index "poll_recounts", ["officer_assignment_id"], name: "index_poll_recounts_on_officer_assignment_id", using: :btree
create_table "poll_voters", force: :cascade do |t|
t.string "document_number"
t.string "document_type"
@@ -1055,8 +1041,6 @@ ActiveRecord::Schema.define(version: 20170713110317) do
add_foreign_key "poll_questions", "polls"
add_foreign_key "poll_questions", "proposals"
add_foreign_key "poll_questions", "users", column: "author_id"
add_foreign_key "poll_recounts", "poll_booth_assignments", column: "booth_assignment_id"
add_foreign_key "poll_recounts", "poll_officer_assignments", column: "officer_assignment_id"
add_foreign_key "poll_voters", "polls"
add_foreign_key "poll_white_results", "poll_booth_assignments", column: "booth_assignment_id"
add_foreign_key "poll_white_results", "poll_officer_assignments", column: "officer_assignment_id"