Files
grecia/db/migrate/20170125114952_add_answer_id_to_poll_voters.rb
Javi Martín 55addaa58a Apply rubocop rules to migration files
There are some rules which only affect migration files, and we cannot
enable them if we're excluding those files from being inspected.

We're also changing migrations related to the Rails/TimeZone rule
slightly because these fields were already changed afterwards, so we
aren't changing the schema.
2019-10-24 20:35:13 +02:00

10 lines
325 B
Ruby

class AddAnswerIdToPollVoters < ActiveRecord::Migration[4.2]
def change
add_column :poll_voters, :answer_id, :integer, default: nil
add_index :poll_voters, :document_number
add_index :poll_voters, :poll_id
add_index :poll_voters, [:poll_id, :document_number, :document_type], name: "doc_by_poll"
end
end