diff --git a/db/migrate/20170201113206_adds_fields_to_poll_partial_results.rb b/db/migrate/20170201113206_adds_fields_to_poll_partial_results.rb new file mode 100644 index 000000000..3755dc700 --- /dev/null +++ b/db/migrate/20170201113206_adds_fields_to_poll_partial_results.rb @@ -0,0 +1,9 @@ +class AddsFieldsToPollPartialResults < ActiveRecord::Migration + def change + add_column :poll_partial_results, :date, :date + add_column :poll_partial_results, :booth_assignment_id, :integer + add_column :poll_partial_results, :officer_assignment_id, :integer + + add_index :poll_partial_results, [:booth_assignment_id, :date] + end +end diff --git a/db/schema.rb b/db/schema.rb index 544d2a6ff..13ad1dce7 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20170130171322) do +ActiveRecord::Schema.define(version: 20170201113206) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -430,10 +430,14 @@ ActiveRecord::Schema.define(version: 20170130171322) do t.string "answer" t.integer "amount" t.string "origin" + t.date "date" + t.integer "booth_assignment_id" + t.integer "officer_assignment_id" end add_index "poll_partial_results", ["answer"], name: "index_poll_partial_results_on_answer", using: :btree add_index "poll_partial_results", ["author_id"], name: "index_poll_partial_results_on_author_id", using: :btree + add_index "poll_partial_results", ["booth_assignment_id", "date"], name: "index_poll_partial_results_on_booth_assignment_id_and_date", using: :btree add_index "poll_partial_results", ["origin"], name: "index_poll_partial_results_on_origin", using: :btree add_index "poll_partial_results", ["question_id"], name: "index_poll_partial_results_on_question_id", using: :btree