]> git.openstreetmap.org Git - rails.git/blob - db/migrate/042_add_foreign_keys_to_oauth_tables.rb
Detect changes to the user image correctly
[rails.git] / db / migrate / 042_add_foreign_keys_to_oauth_tables.rb
1 require 'migrate'
2
3 class AddForeignKeysToOauthTables < ActiveRecord::Migration
4   def self.up
5     add_foreign_key :oauth_tokens, [:user_id], :users, [:id]
6     add_foreign_key :oauth_tokens, [:client_application_id], :client_applications, [:id]
7     add_foreign_key :client_applications, [:user_id], :users, [:id]
8   end
9
10   def self.down
11     remove_foreign_key :oauth_tokens, [:user_id], :users
12     remove_foreign_key :oauth_tokens, [:client_application_id], :client_applications
13     remove_foreign_key :client_applications, [:user_id], :users
14   end
15 end