-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevents deleting print addresses when doing GDPR removal
remp/helpdesk#295
- Loading branch information
Showing
2 changed files
with
45 additions
and
17 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
src/migrations/20210216114454_add_deleted_at_to_gdpr_removed_addresses.php
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
use Phinx\Migration\AbstractMigration; | ||
|
||
class AddDeletedAtToGdprRemovedAddresses extends AbstractMigration | ||
{ | ||
public function up() | ||
{ | ||
$sql = <<<SQL | ||
UPDATE addresses SET deleted_at = updated_at | ||
WHERE first_name = 'GDPR removal' AND last_name = 'GDPR removal' AND address = 'GDPR removal' | ||
SQL; | ||
$this->execute($sql); | ||
} | ||
|
||
public function down() | ||
{ | ||
$this->output->writeln('Down migration is not available.'); | ||
} | ||
} |
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