migration for old invitation-emails
This commit is contained in:
parent
92c799f699
commit
48392e717b
2 changed files with 18 additions and 1 deletions
|
|
@ -0,0 +1,17 @@
|
|||
class RemoveInvitationEmailFromUsers < ActiveRecord::Migration
|
||||
def self.up
|
||||
execute <<-SQL
|
||||
UPDATE users
|
||||
SET email = concat('invitemail_', id, '@example.org')
|
||||
WHERE invitation_token IS NOT NULL
|
||||
SQL
|
||||
end
|
||||
|
||||
def self.down
|
||||
execute <<-SQL
|
||||
UPDATE users
|
||||
SET email = (SELECT identifier FROM invitations WHERE invitations.recipient_id = users.id)
|
||||
WHERE invitation_token IS NOT NULL
|
||||
SQL
|
||||
end
|
||||
end
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20120322223517) do
|
||||
ActiveRecord::Schema.define(:version => 20120328025842) do
|
||||
|
||||
create_table "account_deletions", :force => true do |t|
|
||||
t.string "diaspora_handle"
|
||||
|
|
|
|||
Loading…
Reference in a new issue