From 6e146bfba9b6fa6df3733fc1fec46cb842e61652 Mon Sep 17 00:00:00 2001 From: Matt Amos Date: Mon, 3 Aug 2009 13:58:10 +0000 Subject: [PATCH] Added foreign keys to some oauth tables. --- .../040_add_foreign_keys_to_oauth_tables.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 db/migrate/040_add_foreign_keys_to_oauth_tables.rb diff --git a/db/migrate/040_add_foreign_keys_to_oauth_tables.rb b/db/migrate/040_add_foreign_keys_to_oauth_tables.rb new file mode 100644 index 000000000..09de54349 --- /dev/null +++ b/db/migrate/040_add_foreign_keys_to_oauth_tables.rb @@ -0,0 +1,15 @@ +require 'lib/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 + end +end -- 2.39.5