Skip to content
Extraits de code Groupes Projets
Valider 8b278adf rédigé par Maxwell Salzberg's avatar Maxwell Salzberg
Parcourir les fichiers

migration to fix old invites for resend

parent 7d9b1636
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
class AddIdentifierToExistingInvitations < ActiveRecord::Migration
def self.up
execute <<SQL
UPDATE invitations
SET invitations.identifier = (SELECT users.invitation_identifier FROM users WHERE users.id = invitations.recipient_id),
invitations.service = (SELECT users.invitation_service FROM users WHERE users.id = invitations.recipient_id)
WHERE invitations.identifier IS NULL
SQL
end
def self.down
execute <<SQL
UPDATE invitations
SET invitations.identifier = NULL,
invitations.service = NULL
WHERE (SELECT users.invitation_identifier FROM users WHERE users.id = invitations.recipient_id) IS NOT NULL
SQL
end
end
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
# #
# It's strongly recommended to check this file into your version control system. # It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20110816061820) do ActiveRecord::Schema.define(:version => 20110818212541) do
create_table "aspect_memberships", :force => true do |t| create_table "aspect_memberships", :force => true do |t|
t.integer "aspect_id", :null => false t.integer "aspect_id", :null => false
......
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