diff --git a/db/migrate/20120328025842_remove_invitation_email_from_users.rb b/db/migrate/20120328025842_remove_invitation_email_from_users.rb new file mode 100644 index 000000000..c08202ce4 --- /dev/null +++ b/db/migrate/20120328025842_remove_invitation_email_from_users.rb @@ -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 diff --git a/db/schema.rb b/db/schema.rb index 1f2bfd100..763db208c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -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"