20181116165755_create_account_stats.rb 451 B

1234567891011121314
  1. # frozen_string_literal: true
  2. class CreateAccountStats < ActiveRecord::Migration[5.2]
  3. def change
  4. create_table :account_stats do |t|
  5. t.belongs_to :account, null: false, foreign_key: { on_delete: :cascade }, index: { unique: true }
  6. t.bigint :statuses_count, null: false, default: 0
  7. t.bigint :following_count, null: false, default: 0
  8. t.bigint :followers_count, null: false, default: 0
  9. t.timestamps
  10. end
  11. end
  12. end