<?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 Version20241030143839 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('ALTER TABLE company ADD hash VARCHAR(255) NOT NULL, ADD status INT NOT NULL, ADD is_removed TINYINT(1) NOT NULL, ADD cdate DATETIME NOT NULL, ADD mdate DATETIME DEFAULT NULL');
$this->addSql('CREATE UNIQUE INDEX UNIQ_4FBF094FD1B862B8 ON company (hash)');
$this->addSql('ALTER TABLE company_plans ADD hash VARCHAR(255) NOT NULL, ADD status INT NOT NULL, ADD is_removed TINYINT(1) NOT NULL, ADD cdate DATETIME NOT NULL, ADD mdate DATETIME DEFAULT NULL');
$this->addSql('CREATE UNIQUE INDEX UNIQ_72963AB4D1B862B8 ON company_plans (hash)');
$this->addSql('ALTER TABLE customer_service_available ADD manager_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE customer_service_available ADD CONSTRAINT FK_E90F63D2783E3463 FOREIGN KEY (manager_id) REFERENCES manager (id)');
$this->addSql('CREATE INDEX IDX_E90F63D2783E3463 ON customer_service_available (manager_id)');
$this->addSql('ALTER TABLE customer_subscription ADD status INT NOT NULL, ADD is_removed TINYINT(1) NOT NULL, ADD mdate DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE customer_taxation_available ADD manager_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE customer_taxation_available ADD CONSTRAINT FK_4C621076783E3463 FOREIGN KEY (manager_id) REFERENCES manager (id)');
$this->addSql('CREATE INDEX IDX_4C621076783E3463 ON customer_taxation_available (manager_id)');
$this->addSql('DROP INDEX UNIQ_FA2425B9E7927C74 ON manager');
$this->addSql('ALTER TABLE manager ADD hash VARCHAR(255) NOT NULL, ADD is_removed TINYINT(1) NOT NULL, ADD cdate DATETIME NOT NULL, ADD mdate DATETIME DEFAULT NULL, CHANGE email email VARCHAR(255) NOT NULL, CHANGE surname surname VARCHAR(255) DEFAULT NULL, CHANGE num_max_taxations status INT NOT NULL');
$this->addSql('CREATE UNIQUE INDEX UNIQ_FA2425B9D1B862B8 ON manager (hash)');
$this->addSql('ALTER TABLE manager_plans ADD hash VARCHAR(255) NOT NULL, ADD status INT NOT NULL, ADD is_removed TINYINT(1) NOT NULL, ADD cdate DATETIME NOT NULL, ADD mdate DATETIME DEFAULT NULL, CHANGE units_available designated_units INT NOT NULL');
$this->addSql('CREATE UNIQUE INDEX UNIQ_1CB858EBD1B862B8 ON manager_plans (hash)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP INDEX UNIQ_4FBF094FD1B862B8 ON company');
$this->addSql('ALTER TABLE company DROP hash, DROP status, DROP is_removed, DROP cdate, DROP mdate');
$this->addSql('DROP INDEX UNIQ_72963AB4D1B862B8 ON company_plans');
$this->addSql('ALTER TABLE company_plans DROP hash, DROP status, DROP is_removed, DROP cdate, DROP mdate');
$this->addSql('ALTER TABLE customer_service_available DROP FOREIGN KEY FK_E90F63D2783E3463');
$this->addSql('DROP INDEX IDX_E90F63D2783E3463 ON customer_service_available');
$this->addSql('ALTER TABLE customer_service_available DROP manager_id');
$this->addSql('ALTER TABLE customer_subscription DROP status, DROP is_removed, DROP mdate');
$this->addSql('ALTER TABLE customer_taxation_available DROP FOREIGN KEY FK_4C621076783E3463');
$this->addSql('DROP INDEX IDX_4C621076783E3463 ON customer_taxation_available');
$this->addSql('ALTER TABLE customer_taxation_available DROP manager_id');
$this->addSql('DROP INDEX UNIQ_FA2425B9D1B862B8 ON manager');
$this->addSql('ALTER TABLE manager DROP hash, DROP is_removed, DROP cdate, DROP mdate, CHANGE email email VARCHAR(50) NOT NULL, CHANGE surname surname VARCHAR(255) NOT NULL, CHANGE status num_max_taxations INT NOT NULL');
$this->addSql('CREATE UNIQUE INDEX UNIQ_FA2425B9E7927C74 ON manager (email)');
$this->addSql('DROP INDEX UNIQ_1CB858EBD1B862B8 ON manager_plans');
$this->addSql('ALTER TABLE manager_plans ADD units_available INT NOT NULL, DROP designated_units, DROP hash, DROP status, DROP is_removed, DROP cdate, DROP mdate');
}
}