<?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 Version20220523125355 extends AbstractMigration
{
public function getDescription(): string
{
return 'Adds the video event promotion';
}
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 (id INT AUTO_INCREMENT NOT NULL, specialist_id INT DEFAULT NULL, company_id INT DEFAULT NULL, tag_id INT DEFAULT NULL, start DATETIME NOT NULL, end DATETIME NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, amount DOUBLE PRECISION DEFAULT NULL, percentage DOUBLE PRECISION DEFAULT NULL, INDEX IDX_EF93DBCD7B100C1A (specialist_id), INDEX IDX_EF93DBCD979B1AD6 (company_id), INDEX IDX_EF93DBCDBAD26311 (tag_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE visio_event_promotion ADD CONSTRAINT FK_EF93DBCD7B100C1A FOREIGN KEY (specialist_id) REFERENCES specialist (id)');
$this->addSql('ALTER TABLE visio_event_promotion ADD CONSTRAINT FK_EF93DBCD979B1AD6 FOREIGN KEY (company_id) REFERENCES company (id)');
$this->addSql('ALTER TABLE visio_event_promotion ADD CONSTRAINT FK_EF93DBCDBAD26311 FOREIGN KEY (tag_id) REFERENCES tag (id)');
}
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');
}
}