20190225031625_create_poll_votes.rb 349 B

12345678910111213
  1. # frozen_string_literal: true
  2. class CreatePollVotes < ActiveRecord::Migration[5.2]
  3. def change
  4. create_table :poll_votes do |t|
  5. t.belongs_to :account, foreign_key: { on_delete: :cascade }
  6. t.belongs_to :poll, foreign_key: { on_delete: :cascade }
  7. t.integer :choice, null: false, default: 0
  8. t.timestamps
  9. end
  10. end
  11. end