20190914202517_create_account_migrations.rb 451 B

1234567891011121314
  1. # frozen_string_literal: true
  2. class CreateAccountMigrations < ActiveRecord::Migration[5.2]
  3. def change
  4. create_table :account_migrations do |t|
  5. t.belongs_to :account, foreign_key: { on_delete: :cascade }
  6. t.string :acct, null: false, default: ''
  7. t.bigint :followers_count, null: false, default: 0
  8. t.belongs_to :target_account, foreign_key: { to_table: :accounts, on_delete: :nullify }
  9. t.timestamps
  10. end
  11. end
  12. end