Skip to content
Extraits de code Groupes Projets
Valider ce5c1ef0 rédigé par Daniel Grippi's avatar Daniel Grippi
Parcourir les fichiers

Merge pull request #2052 from gladiac/fix_mysql

db: Fixed the migration of the database.
parents 4bd1f099 df86bc57
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -133,10 +133,10 @@ class CreateSchema < ActiveRecord::Migration ...@@ -133,10 +133,10 @@ class CreateSchema < ActiveRecord::Migration
add_index :requests, [:sender_id, :recipient_id], :unique => true add_index :requests, [:sender_id, :recipient_id], :unique => true
create_table :services do |t| create_table :services do |t|
t.string :type t.string :type, :limit => 127
t.integer :user_id t.integer :user_id
t.string :provider t.string :provider
t.string :uid t.string :uid, :limit => 127
t.string :access_token t.string :access_token
t.string :access_secret t.string :access_secret
t.string :nickname t.string :nickname
......
class AddIndexesToSerivces < ActiveRecord::Migration class AddIndexesToSerivces < ActiveRecord::Migration
def self.up def self.up
change_column(:services, :type, :string, :limit => 127)
change_column(:services, :uid, :string, :limit => 127)
add_index :services, [:type, :uid] add_index :services, [:type, :uid]
end end
......
class FixIndexesToSerivces < ActiveRecord::Migration
# This alters the tables to avoid a mysql bug
# See http://bugs.joindiaspora.com/issues/835
def self.up
remove_index :services, :column => [:type, :uid]
change_column(:services, :type, :string, :limit => 127)
change_column(:services, :uid, :string, :limit => 127)
add_index :services, [:type, :uid]
end
def self.down
remove_index :services, :column => [:type, :uid]
end
end
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter