<?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 Version20211005152816 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('CREATE TABLE partner_pending (id INT AUTO_INCREMENT NOT NULL, partner_id INT NOT NULL, user_account_id INT DEFAULT NULL, civility VARCHAR(6) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, firstname VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, birthname VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, phone_number VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, email VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, token VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, UNIQUE INDEX UNIQ_133F19A43C0C9956 (user_account_id), INDEX IDX_133F19A49393F8FE (partner_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE partner_pending ADD CONSTRAINT FK_133F19A43C0C9956 FOREIGN KEY (user_account_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE partner_pending ADD CONSTRAINT FK_133F19A49393F8FE FOREIGN KEY (partner_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE child CHANGE birthDate birthDate DATETIME NOT NULL');
$this->addSql('ALTER TABLE complaint_x CHANGE factsDiscoverHour factsDiscoverHour DATETIME DEFAULT NULL, CHANGE factsBeginHour factsBeginHour DATETIME DEFAULT NULL, CHANGE factsEndHour factsEndHour DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE disaster_declaration CHANGE secondFactsHour secondFactsHour DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE good_assignement CHANGE transactionDate transactionDate DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE loss_report CHANGE lossDate lossDate DATETIME NOT NULL');
$this->addSql('ALTER TABLE user ADD pending_new_email VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, ADD validation_token VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE civility civility VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE partner_pending');
$this->addSql('ALTER TABLE child CHANGE birthDate birthDate DATETIME NOT NULL');
$this->addSql('ALTER TABLE complaint_x CHANGE factsDiscoverHour factsDiscoverHour DATETIME DEFAULT NULL, CHANGE factsBeginHour factsBeginHour DATETIME DEFAULT NULL, CHANGE factsEndHour factsEndHour DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE disaster_declaration CHANGE secondFactsHour secondFactsHour DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE good_assignement CHANGE transactionDate transactionDate DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE loss_report CHANGE lossDate lossDate DATETIME NOT NULL');
$this->addSql('ALTER TABLE user DROP pending_new_email, DROP validation_token, CHANGE civility civility VARCHAR(255) DEFAULT NULL');
}
}