Skip to content

Instantly share code, notes, and snippets.

@Hotfirenet
Last active April 19, 2017 08:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hotfirenet/e0ad4bee17bcc8ae3bd42c78fc36b047 to your computer and use it in GitHub Desktop.
Save Hotfirenet/e0ad4bee17bcc8ae3bd42c78fc36b047 to your computer and use it in GitHub Desktop.
permet d'anonymiser prestashop pour faire un labo
/* NEED https://gist.github.com/Hotfirenet/6059aa528800c1bb944fa5b7d8fcbf42 */
TRUNCATE TABLE ps_connections;
TRUNCATE TABLE ps_connections_page;
TRUNCATE TABLE ps_connections_source;
TRUNCATE TABLE ps_customer_ip;
TRUNCATE TABLE ps_customer_message;
TRUNCATE TABLE ps_customer_thread;
TRUNCATE TABLE ps_mail;
TRUNCATE TABLE ps_message;
TRUNCATE TABLE ps_message_readed;
TRUNCATE TABLE ps_newsletter;
TRUNCATE TABLE ps_socolissimo_delivery_info;
TRUNCATE TABLE ps_suivilaposte;
UPDATE ps_address
SET company = ''
,address1 = CONCAT(FLOOR(rand() * 100),' ', genstring(ROUND((RAND() * (50-1))+1)))
,address2 = ''
,phone =''
,phone_mobile =''
WHERE id_customer NOT IN (idCustomer);
UPDATE ps_dmurealtimestats_visiteurs
SET ip = '';
UPDATE ps_customer
SET firstname = genstring(ROUND((RAND() * (8-1))+1))
,lastname = genstring(ROUND((RAND() * (10-1))+1))
,email = CONCAT(genstring(ROUND((RAND() * (30-5))+5)), genstring(ROUND((RAND() * (8-1))+1)))
,passwd = genstring(ROUND((RAND() * (15-1))+1))
,birthday = '0000-00-00'
,ip_registration_newsletter = ''
,secure_key = genstring(ROUND((RAND() * (15-1))+1))
,atoosync_code_client = ''
WHERE id_customer NOT IN (idCustomer);
UPDATE ps_order_payment
SET transaction_id = FLOOR(rand() * 10000)
,card_number = '';
UPDATE ps_paypal_customer PC
INNER JOIN ps_customer C ON C.id_customer = PC.id_customer
SET paypal_email = C.email;
UPDATE ps_paypal_order
SET id_transaction = '';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment