<?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 Version20230206115945 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 comment (id INT AUTO_INCREMENT NOT NULL, deal_id INT NOT NULL, child_deal_id INT DEFAULT NULL, site_id INT NOT NULL, name VARCHAR(100) DEFAULT NULL, email VARCHAR(100) DEFAULT NULL, comment LONGTEXT DEFAULT NULL, ip VARCHAR(40) DEFAULT NULL, status VARCHAR(50) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_9474526CF60E2305 (deal_id), INDEX IDX_9474526C94BA6B1E (child_deal_id), INDEX IDX_9474526CF6BD1646 (site_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE comment ADD CONSTRAINT FK_9474526CF60E2305 FOREIGN KEY (deal_id) REFERENCES deal (id)');
$this->addSql('ALTER TABLE comment ADD CONSTRAINT FK_9474526C94BA6B1E FOREIGN KEY (child_deal_id) REFERENCES deal (id)');
$this->addSql('ALTER TABLE comment ADD CONSTRAINT FK_9474526CF6BD1646 FOREIGN KEY (site_id) REFERENCES site (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE comment');
}
}