<?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 Version20240730090338 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 manager_recovery (id INT AUTO_INCREMENT NOT NULL, manager_id INT NOT NULL, token VARCHAR(255) NOT NULL, expiration DATETIME NOT NULL, hash VARCHAR(255) NOT NULL, status INT NOT NULL, is_removed TINYINT(1) NOT NULL, cdate DATETIME NOT NULL, mdate DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_729EBADD1B862B8 (hash), INDEX IDX_729EBAD783E3463 (manager_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE manager_recovery ADD CONSTRAINT FK_729EBAD783E3463 FOREIGN KEY (manager_id) REFERENCES manager (id)');
$this->addSql('ALTER TABLE manager ADD description VARCHAR(255) DEFAULT NULL, ADD avatar VARCHAR(255) DEFAULT NULL, ADD num_max_taxations INT NOT NULL, CHANGE email email VARCHAR(50) NOT NULL, CHANGE surname surname VARCHAR(255) NOT NULL');
$this->addSql('CREATE UNIQUE INDEX UNIQ_FA2425B9E7927C74 ON manager (email)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE manager_recovery');
$this->addSql('DROP INDEX UNIQ_FA2425B9E7927C74 ON manager');
$this->addSql('ALTER TABLE manager DROP description, DROP avatar, DROP num_max_taxations, CHANGE email email VARCHAR(255) NOT NULL, CHANGE surname surname VARCHAR(255) DEFAULT NULL');
}
}