1
0

20190225031541_create_polls.rb 655 B

12345678910111213141516171819
  1. # frozen_string_literal: true
  2. class CreatePolls < ActiveRecord::Migration[5.2]
  3. def change
  4. create_table :polls do |t|
  5. t.belongs_to :account, foreign_key: { on_delete: :cascade }
  6. t.belongs_to :status, foreign_key: { on_delete: :cascade }
  7. t.datetime :expires_at
  8. t.string :options, null: false, array: true, default: []
  9. t.bigint :cached_tallies, null: false, array: true, default: []
  10. t.boolean :multiple, null: false, default: false
  11. t.boolean :hide_totals, null: false, default: false
  12. t.bigint :votes_count, null: false, default: 0
  13. t.datetime :last_fetched_at
  14. t.timestamps
  15. end
  16. end
  17. end