masquerade
masquerade copied to clipboard
Shopware 6 anonymization does not anonymize completely
But for some reason it duplicates the to-be-anonimized record and anonimizes that one. Maybe because of the binary UUID's?
But not all tables. customer
, customer_address
, newsletter_recipient
, user
, etc seem to be unaffected. order_customer
and order_address
contain the duplicate records.
order_customer
and order_address
table seems to contain multiple records with the same id
?
I guess the problem stems from here, where MySQL doesn't recognize it as an existing row and inserts a new one; https://github.com/elgentos/masquerade/blob/master/src/Elgentos/Masquerade/DataProcessor/TableService.php#L378
Probably because the table has two primary keys and Masquerade identifies the wrong one;
mysql> describe order_customer;
+------------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------------+--------------+------+-----+---------+-------+
| id | binary(16) | NO | PRI | NULL | |
| version_id | binary(16) | NO | PRI | NULL | |
| customer_id | binary(16) | YES | MUL | NULL | |
| order_id | binary(16) | NO | MUL | NULL | |
| order_version_id | binary(16) | NO | | NULL | |
| email | varchar(254) | NO | | NULL | |
| salutation_id | binary(16) | NO | MUL | NULL | |
| first_name | varchar(255) | NO | | NULL | |
| last_name | varchar(255) | NO | | NULL | |
| title | varchar(100) | YES | | NULL | |
| company | varchar(255) | YES | | NULL | |
| customer_number | varchar(255) | YES | | NULL | |
| custom_fields | json | YES | | NULL | |
| created_at | datetime(3) | NO | | NULL | |
| updated_at | datetime(3) | YES | | NULL | |
| remote_address | varchar(255) | YES | | NULL | |
+------------------+--------------+------+-----+---------+-------+
This problem occurs because Masquerade at this point assumes a table only has one primary key. @IvanChepurnyi any idea how to allow for multiple PK's?