Bootstrap encoder for documents

This commit is contained in:
2021-11-22 09:05:15 +00:00
parent 46a4afe1b3
commit d0bf47e0d5
25 changed files with 992 additions and 91 deletions

View File

@@ -0,0 +1,37 @@
<?php
declare(strict_types=1);
namespace Chill\Migrations\Person;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* drop not null in person phonenumber
*/
final class Version20211112170027 extends AbstractMigration
{
public function getDescription(): string
{
return 'Drop not null in person table: set default empty value';
}
public function up(Schema $schema): void
{
$this->addSql('UPDATE chill_person_person SET mobilenumber = \'\' WHERE mobilenumber IS NULL');
$this->addSql('UPDATE chill_person_person SET phonenumber = \'\' WHERE phonenumber IS NULL');
$this->addSql('ALTER TABLE chill_person_person ALTER mobilenumber SET NOT NULL');
$this->addSql('ALTER TABLE chill_person_person ALTER phonenumber SET NOT NULL');
$this->addSql('ALTER TABLE chill_person_person ALTER mobilenumber SET DEFAULT \'\'');
$this->addSql('ALTER TABLE chill_person_person ALTER phonenumber SET DEFAULT \'\'');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE chill_person_person ALTER mobilenumber DROP NOT NULL');
$this->addSql('ALTER TABLE chill_person_person ALTER phonenumber DROP NOT NULL');
$this->addSql('ALTER TABLE chill_person_person ALTER mobilenumber SET DEFAULT NULL');
$this->addSql('ALTER TABLE chill_person_person ALTER phonenumber SET DEFAULT NULL');
}
}