elgentos/masquerade

Skipping a group/table/column doesn't work

michalrostek opened this issue · 0 comments

Prerequisites:

  • PHP 8.1
  • Magento 2.4
  • e.g. config/magento2/admin.yaml with admin: only (the indicated group is only an example)

Actual result:

$ php masquerade.phar run --group admin
[Foreign key constraint checking is off - deletions will not affect linked tables]

._ _  _. _ _.    _ .__. _| _
| | |(_|_>(_||_|(/_|(_|(_|(/_
            |
                   by elgentos
                        v1.2.2
PHP Warning:  foreach() argument must be of type array|object, null given in phar:///var/www/magento/masquerade.phar/src/Elgentos/Masquerade/Console/RunCommand.php on line 131

Warning: foreach() argument must be of type array|object, null given in phar:///var/www/magento/masquerade.phar/src/Elgentos/Masquerade/Console/RunCommand.php on line 131
Anonymization complete in [0:0:0]

Additionally (although this functionality may not be there yet):

  1. We can't skip table within group.
admin:
    admin_user:
$ php masquerade.phar run --group admin
[Foreign key constraint checking is off - deletions will not affect linked tables]

._ _  _. _ _.    _ .__. _| _
| | |(_|_>(_||_|(/_|(_|(_|(/_
            |
                   by elgentos
                        v1.2.2

Updating [admin_user]
 ERROR:                                                                                 
 There must be at least 2 columns specified for update columns (one pk and one regular) 
  1. We can't skip the field/column either, because it inserts empty values (not null).
admin:
    admin_user:
        columns:
            password:
$ php masquerade.phar run --group admin
[Foreign key constraint checking is off - deletions will not affect linked tables]

._ _  _. _ _.    _ .__. _| _
| | |(_|_>(_||_|(/_|(_|(_|(/_
            |
                   by elgentos
                        v1.2.2

Updating [admin_user]
 2/2 [============================] 100% < 1 sec Complete
Anonymization complete in [0:0:0]