Skip to content
This repository was archived by the owner on Oct 19, 2023. It is now read-only.
This repository was archived by the owner on Oct 19, 2023. It is now read-only.

Skipping a group/table/column doesn't work #109

@michalrostek

Description

@michalrostek

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions