1
0

20190225031541_create_polls.rb 624 B

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