<?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 Version20211215131323 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 scan_category (id INT AUTO_INCREMENT NOT NULL, category_id INT NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_C777DD0412469DE2 (category_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE scan_page (id INT AUTO_INCREMENT NOT NULL, page_id INT NOT NULL, scancategory_id INT NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', response_status INT NOT NULL, response_message VARCHAR(255) DEFAULT NULL, data LONGTEXT NOT NULL, changed TINYINT(1) DEFAULT NULL, INDEX IDX_E17154BBC4663E4 (page_id), INDEX IDX_E17154BB5B898903 (scancategory_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE scan_category ADD CONSTRAINT FK_C777DD0412469DE2 FOREIGN KEY (category_id) REFERENCES category (id)');
$this->addSql('ALTER TABLE scan_page ADD CONSTRAINT FK_E17154BBC4663E4 FOREIGN KEY (page_id) REFERENCES page (id)');
$this->addSql('ALTER TABLE scan_page ADD CONSTRAINT FK_E17154BB5B898903 FOREIGN KEY (scancategory_id) REFERENCES scan_category (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE scan_page DROP FOREIGN KEY FK_E17154BB5B898903');
$this->addSql('DROP TABLE scan_category');
$this->addSql('DROP TABLE scan_page');
}
}