<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20231121133017 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('UPDATE user u
SET deleted = true,
deleted_at = (SELECT deleted_at FROM shop s WHERE u.shop_id = s.id),
email = concat("deleted-", FLOOR(1 + RAND() * 60 ), "-", email),
username = concat("deleted-", FLOOR(1 + RAND() * 60 ), "-", username),
phone = null
WHERE shop_id IN (
SELECT s.id
FROM shop s
WHERE s.deleted = true AND s.deleted_at IS NOT NULL
)
AND u.deleted = false AND u.deleted_at IS NULL
');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
}
}