migrations/Version20220601135305.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20220601135305 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $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');
  19.         $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');
  20.         $this->addSql('ALTER TABLE visio_event_promotion_specialist ADD CONSTRAINT FK_C548E6737B100C1A FOREIGN KEY (specialist_id) REFERENCES specialist (id) ON DELETE CASCADE');
  21.         $this->addSql('ALTER TABLE visio_event_promotion DROP FOREIGN KEY FK_EF93DBCD7B100C1A');
  22.         $this->addSql('DROP INDEX IDX_EF93DBCD7B100C1A ON visio_event_promotion');
  23.         $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');
  24.     }
  25.     public function down(Schema $schema): void
  26.     {
  27.         // this down() migration is auto-generated, please modify it to your needs
  28.         $this->addSql('DROP TABLE visio_event_promotion_specialist');
  29.         $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');
  30.         $this->addSql('ALTER TABLE visio_event_promotion ADD CONSTRAINT FK_EF93DBCD7B100C1A FOREIGN KEY (specialist_id) REFERENCES specialist (id)');
  31.         $this->addSql('CREATE INDEX IDX_EF93DBCD7B100C1A ON visio_event_promotion (specialist_id)');
  32.     }
  33. }