<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20211104171036 extends AbstractMigration
{
public function getDescription(): string
{
return 'Review migration';
}
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE review (id INT AUTO_INCREMENT NOT NULL, user_reviewer_id INT DEFAULT NULL, user_reviewable_id INT DEFAULT NULL, search_match_id INT DEFAULT NULL, text VARCHAR(4000) NOT NULL, note INT NOT NULL, INDEX IDX_794381C6D94C8F83 (user_reviewer_id), INDEX IDX_794381C6A160BA32 (user_reviewable_id), INDEX IDX_794381C63AE90763 (search_match_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE review ADD CONSTRAINT FK_794381C6D94C8F83 FOREIGN KEY (user_reviewer_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE review ADD CONSTRAINT FK_794381C6A160BA32 FOREIGN KEY (user_reviewable_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE review ADD CONSTRAINT FK_794381C63AE90763 FOREIGN KEY (search_match_id) REFERENCES search_match (id)');
}
public function down(Schema $schema): void
{
$this->addSql('DROP TABLE review');
}
public function isTransactional(): bool
{
return false;
}
}