about summary refs log tree commit diff
path: root/db/migrate/20181116165755_create_account_stats.rb
blob: a798e8166e981e3555e2e6d132a3c40cae6d01ab (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
class CreateAccountStats < ActiveRecord::Migration[5.2]
  def change
    create_table :account_stats do |t|
      t.belongs_to :account, null: false, foreign_key: { on_delete: :cascade }, index: { unique: true }
      t.bigint :statuses_count, null: false, default: 0
      t.bigint :following_count, null: false, default: 0
      t.bigint :followers_count, null: false, default: 0

      t.timestamps
    end
  end
end