<?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 Version20220323101046 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 specialist_tag ADD price DOUBLE PRECISION NOT NULL, ADD created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, ADD updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP');
$this->addSql('ALTER TABLE tag ADD coef DOUBLE PRECISION NOT NULL DEFAULT "1" AFTER description');
$this->addSql('CREATE TABLE company_tag (tag_id INT NOT NULL, company_id INT NOT NULL, coef DOUBLE PRECISION NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_77A33EBBAD26311 (tag_id), INDEX IDX_77A33EB979B1AD6 (company_id), PRIMARY KEY(tag_id, company_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE company_tag ADD CONSTRAINT FK_77A33EBBAD26311 FOREIGN KEY (tag_id) REFERENCES tag (id)');
$this->addSql('ALTER TABLE company_tag ADD CONSTRAINT FK_77A33EB979B1AD6 FOREIGN KEY (company_id) REFERENCES company (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE specialist_tag DROP price, DROP created_at, DROP updated_at');
$this->addSql('ALTER TABLE tag DROP coef');
$this->addSql('DROP TABLE company_tag');
}
}