20170427011934_re_add_owner_to_application.rb 400 B

12345678910
  1. # frozen_string_literal: true
  2. class ReAddOwnerToApplication < ActiveRecord::Migration[5.0]
  3. def change
  4. add_column :oauth_applications, :owner_id, :integer, null: true
  5. add_column :oauth_applications, :owner_type, :string, null: true
  6. add_index :oauth_applications, [:owner_id, :owner_type]
  7. add_foreign_key :oauth_applications, :users, column: :owner_id, on_delete: :cascade
  8. end
  9. end