Last active
June 25, 2018 14:08
-
-
Save mladenilic/0c6b263efebc50a346648d9da9516e47 to your computer and use it in GitHub Desktop.
Scramble emails in test Magento DB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- mladen@stuntcoders.com -> mladen@example.com | |
UPDATE `customer_entity` SET `email` = REPLACE(`email`, SUBSTRING(`email`, INSTR(`email`, '@') + 1), 'example.com'); | |
UPDATE `sales_flat_quote_address` SET `email` = REPLACE(`email`, SUBSTRING(`email`, INSTR(`email`, '@') + 1), 'example.com'); | |
UPDATE `sales_flat_order_address` SET `email` = REPLACE(`email`, SUBSTRING(`email`, INSTR(`email`, '@') + 1), 'example.com'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In case if you get a
Duplicate Entry
error, you can use it likeUPDATE
customer_entitySET
email= REPLACE(
email, SUBSTRING(
email, INSTR(
email, '@') + 1), CONCAT('example',
entity_id, '.com'));