<?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 Version20220601135305 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 visio_event_promotion_specialist (visio_event_promotion_id INT NOT NULL, specialist_id INT NOT NULL, INDEX IDX_C548E673F4FC1EE6 (visio_event_promotion_id), INDEX IDX_C548E6737B100C1A (specialist_id), PRIMARY KEY(visio_event_promotion_id, specialist_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE visio_event_promotion_specialist ADD CONSTRAINT FK_C548E673F4FC1EE6 FOREIGN KEY (visio_event_promotion_id) REFERENCES visio_event_promotion (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE visio_event_promotion_specialist ADD CONSTRAINT FK_C548E6737B100C1A FOREIGN KEY (specialist_id) REFERENCES specialist (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE visio_event_promotion DROP FOREIGN KEY FK_EF93DBCD7B100C1A');
$this->addSql('DROP INDEX IDX_EF93DBCD7B100C1A ON visio_event_promotion');
$this->addSql('ALTER TABLE visio_event_promotion ADD original_token_amount INT NOT NULL, ADD current_token_amount INT NOT NULL, ADD tokens_per_employee INT NOT NULL, DROP specialist_id, DROP amount, DROP percentage');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE visio_event_promotion_specialist');
$this->addSql('ALTER TABLE visio_event_promotion ADD specialist_id INT DEFAULT NULL, ADD amount DOUBLE PRECISION DEFAULT NULL, ADD percentage DOUBLE PRECISION DEFAULT NULL, DROP original_token_amount, DROP current_token_amount, DROP tokens_per_employee');
$this->addSql('ALTER TABLE visio_event_promotion ADD CONSTRAINT FK_EF93DBCD7B100C1A FOREIGN KEY (specialist_id) REFERENCES specialist (id)');
$this->addSql('CREATE INDEX IDX_EF93DBCD7B100C1A ON visio_event_promotion (specialist_id)');
}
}