20170427011934_re_add_owner_to_application.rb 423 B

123456789101112
  1. # frozen_string_literal: true
  2. class ReAddOwnerToApplication < ActiveRecord::Migration[5.0]
  3. def change
  4. change_table(:oauth_applications, bulk: true) do |t|
  5. t.column :owner_id, :integer, null: true
  6. t.column :owner_type, :string, null: true
  7. end
  8. add_index :oauth_applications, [:owner_id, :owner_type]
  9. add_foreign_key :oauth_applications, :users, column: :owner_id, on_delete: :cascade
  10. end
  11. end