From f7009c57813db1ff579114095c7e959a885323a5 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sun, 16 May 2010 12:48:01 +0100 Subject: [PATCH] Fix OpenID migration to not create authentication tables --- .../053_add_open_id_authentication_tables.rb | 30 ------------------- db/migrate/20100516124737_add_open_id.rb | 11 +++++++ 2 files changed, 11 insertions(+), 30 deletions(-) delete mode 100644 db/migrate/053_add_open_id_authentication_tables.rb create mode 100644 db/migrate/20100516124737_add_open_id.rb diff --git a/db/migrate/053_add_open_id_authentication_tables.rb b/db/migrate/053_add_open_id_authentication_tables.rb deleted file mode 100644 index 7dfff209d..000000000 --- a/db/migrate/053_add_open_id_authentication_tables.rb +++ /dev/null @@ -1,30 +0,0 @@ -class AddOpenIdAuthenticationTables < ActiveRecord::Migration - def self.up - create_table :open_id_authentication_associations, :force => true do |t| - t.integer :issued, :lifetime - t.string :handle, :assoc_type - t.binary :server_url, :secret - end - - create_table :open_id_authentication_nonces, :force => true do |t| - t.integer :timestamp, :null => false - t.string :server_url, :null => true - t.string :salt, :null => false - end - - add_column :users, :openid_url, :string - - add_index :users, [:openid_url], :name => "user_openid_unique_idx", :unique => true - add_index :open_id_authentication_associations, [:server_url], :name => "open_id_associations_server_url_idx" - add_index :open_id_authentication_nonces, [:timestamp], :name => "open_id_nonces_timestamp_idx" - end - - def self.down - remove_index :users, :name => "user_openid_unique_idx" - remove_index :open_id_authentication_associations, :name => "open_id_associations_server_url_idx" - remove_index :open_id_authentication_nonces, :name => "open_id_nonces_timestamp_idx" - remove_column :users, :openid_url - drop_table :open_id_authentication_associations - drop_table :open_id_authentication_nonces - end -end diff --git a/db/migrate/20100516124737_add_open_id.rb b/db/migrate/20100516124737_add_open_id.rb new file mode 100644 index 000000000..2fb9ee5b4 --- /dev/null +++ b/db/migrate/20100516124737_add_open_id.rb @@ -0,0 +1,11 @@ +class AddOpenId < ActiveRecord::Migration + def self.up + add_column :users, :openid_url, :string + add_index :users, [:openid_url], :name => "user_openid_url_idx", :unique => true + end + + def self.down + remove_index :users, :name => "user_openid_url_idx" + remove_column :users, :openid_url + end +end -- 2.39.5