diff options
author | danielgrippi <danielgrippi@gmail.com> | 2011-06-24 01:37:26 +0400 |
---|---|---|
committer | danielgrippi <danielgrippi@gmail.com> | 2011-06-24 01:49:19 +0400 |
commit | 74a7c3ab00e90dbd5d6feecf707dc9da1abd13ee (patch) | |
tree | 3fa1f80b76ff3a202d244cc473d4432bc13ddfc4 /db | |
parent | 052adc32137632dbba8efe50973105efab3a8c4f (diff) |
collapsed oauth2 migrations; made app factory
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20110602224152_diaspora_o_auth_client_fields.rb | 13 | ||||
-rw-r--r-- | db/migrate/20110614005205_add_nonce_and_public_key_to_oauth_clients.rb | 13 | ||||
-rw-r--r-- | db/migrate/20110623210918_add_o_auth2_support.rb (renamed from db/migrate/20110526184644_add_oauth2_tables.rb) | 20 | ||||
-rw-r--r-- | db/schema.rb | 15 |
4 files changed, 26 insertions, 35 deletions
diff --git a/db/migrate/20110602224152_diaspora_o_auth_client_fields.rb b/db/migrate/20110602224152_diaspora_o_auth_client_fields.rb deleted file mode 100644 index 184c1bd0c..000000000 --- a/db/migrate/20110602224152_diaspora_o_auth_client_fields.rb +++ /dev/null @@ -1,13 +0,0 @@ -class DiasporaOAuthClientFields < ActiveRecord::Migration - def self.up - add_column :oauth_clients, :description, :text - add_column :oauth_clients, :homepage_url, :string - add_column :oauth_clients, :icon_url, :string - end - - def self.down - remove_column :oauth_clients, :icon_url - remove_column :oauth_clients, :homepage_url - remove_column :oauth_clients, :description - end -end diff --git a/db/migrate/20110614005205_add_nonce_and_public_key_to_oauth_clients.rb b/db/migrate/20110614005205_add_nonce_and_public_key_to_oauth_clients.rb deleted file mode 100644 index 7623502c6..000000000 --- a/db/migrate/20110614005205_add_nonce_and_public_key_to_oauth_clients.rb +++ /dev/null @@ -1,13 +0,0 @@ -class AddNonceAndPublicKeyToOauthClients < ActiveRecord::Migration - def self.up - add_column :oauth_clients, :nonce, :string, :limit => 64 - add_column :oauth_clients, :public_key, :text - add_index :oauth_clients, :nonce - end - - def self.down - remove_column :oauth_clients, :nonce - remove_column :oauth_clients, :public_key - remove_index :oauth_clients, :nonce - end -end diff --git a/db/migrate/20110526184644_add_oauth2_tables.rb b/db/migrate/20110623210918_add_o_auth2_support.rb index 8b389511f..14b354189 100644 --- a/db/migrate/20110526184644_add_oauth2_tables.rb +++ b/db/migrate/20110623210918_add_o_auth2_support.rb @@ -1,13 +1,21 @@ -class AddOauth2Tables < ActiveRecord::Migration +class AddOAuth2Support < ActiveRecord::Migration def self.up create_table 'oauth_clients', :force => true do |t| t.string 'name', :limit => 127, :null => false + t.text 'description', :null => false + t.string 'homepage_url', :limit => 127, :null => false + t.string 'icon_url', :limit => 127, :null => false + t.string 'oauth_identifier', :limit => 32, :null => false t.string 'oauth_secret', :limit => 32, :null => false + t.string 'nonce', :limit => 64 + t.text 'public_key', :null => false t.text 'permissions_overview', :null => false end add_index :oauth_clients, :name, :unique => true + add_index :oauth_clients, :homepage_url, :unique => true + add_index :oauth_clients, :nonce, :unique => true create_table 'oauth_authorization_codes', :force => true do |t| t.integer 'authorization_id', :null => false @@ -39,11 +47,19 @@ class AddOauth2Tables < ActiveRecord::Migration end def self.down - remove_index "oauth_authorizations", ["resource_owner_id", "resource_owner_type", "client_id"] + remove_index "oauth_authorizations", :name => "index_oauth_authorizations_on_resource_owner_and_client_id" drop_table 'oauth_access_tokens' + drop_table 'oauth_authorizations' + drop_table 'oauth_authorization_codes' + + remove_index :oauth_clients, :column => :nonce + remove_index :oauth_clients, :column => :homepage_url + remove_index :oauth_clients, :column => :name + drop_table 'oauth_clients' end + end diff --git a/db/schema.rb b/db/schema.rb index 2d29c5dd7..69f37ce1d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20110614005205) do +ActiveRecord::Schema.define(:version => 20110623210918) do create_table "aspect_memberships", :force => true do |t| t.integer "aspect_id", :null => false @@ -225,18 +225,19 @@ ActiveRecord::Schema.define(:version => 20110614005205) do create_table "oauth_clients", :force => true do |t| t.string "name", :limit => 127, :null => false + t.text "description", :null => false + t.string "homepage_url", :limit => 127, :null => false + t.string "icon_url", :limit => 127, :null => false t.string "oauth_identifier", :limit => 32, :null => false t.string "oauth_secret", :limit => 32, :null => false - t.text "permissions_overview", :null => false - t.text "description" - t.string "homepage_url" - t.string "icon_url" t.string "nonce", :limit => 64 - t.text "public_key" + t.text "public_key", :null => false + t.text "permissions_overview", :null => false end + add_index "oauth_clients", ["homepage_url"], :name => "index_oauth_clients_on_homepage_url", :unique => true add_index "oauth_clients", ["name"], :name => "index_oauth_clients_on_name", :unique => true - add_index "oauth_clients", ["nonce"], :name => "index_oauth_clients_on_nonce" + add_index "oauth_clients", ["nonce"], :name => "index_oauth_clients_on_nonce", :unique => true create_table "people", :force => true do |t| t.string "guid", :null => false |