X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/908a6ef409518d86bfd2cdf0d2a82a6c312821c8..efa37f6a837bb89b21ea3d29496fdd8135d05487:/db/migrate/042_add_foreign_keys_to_oauth_tables.rb diff --git a/db/migrate/042_add_foreign_keys_to_oauth_tables.rb b/db/migrate/042_add_foreign_keys_to_oauth_tables.rb index 09de54349..4268dddd1 100644 --- a/db/migrate/042_add_foreign_keys_to_oauth_tables.rb +++ b/db/migrate/042_add_foreign_keys_to_oauth_tables.rb @@ -1,15 +1,9 @@ -require 'lib/migrate' +require "migrate" -class AddForeignKeysToOauthTables < ActiveRecord::Migration - def self.up - add_foreign_key :oauth_tokens, [:user_id], :users, [:id] - add_foreign_key :oauth_tokens, [:client_application_id], :client_applications, [:id] - add_foreign_key :client_applications, [:user_id], :users, [:id] - end - - def self.down - remove_foreign_key :oauth_tokens, [:user_id], :users - remove_foreign_key :oauth_tokens, [:client_application_id], :client_applications - remove_foreign_key :client_applications, [:user_id], :users +class AddForeignKeysToOauthTables < ActiveRecord::Migration[5.0] + def change + add_foreign_key :oauth_tokens, :users, :name => "oauth_tokens_user_id_fkey" + add_foreign_key :oauth_tokens, :client_applications, :name => "oauth_tokens_client_application_id_fkey" + add_foreign_key :client_applications, :users, :name => "client_applications_user_id_fkey" end end