<?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 Version20240829140100 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 open_port (id INT AUTO_INCREMENT NOT NULL, exposed_ip_id INT DEFAULT NULL, status_id INT DEFAULT 1, port INT NOT NULL, is_active TINYINT(1) DEFAULT 1 NOT NULL, last_seen DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_FA651CE95539FF52 (exposed_ip_id), INDEX IDX_FA651CE96BF700BD (status_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE open_port ADD CONSTRAINT FK_FA651CE95539FF52 FOREIGN KEY (exposed_ip_id) REFERENCES exposed_ip (id)');
$this->addSql('ALTER TABLE open_port ADD CONSTRAINT FK_FA651CE96BF700BD FOREIGN KEY (status_id) REFERENCES status (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE open_port DROP FOREIGN KEY FK_FA651CE95539FF52');
$this->addSql('ALTER TABLE open_port DROP FOREIGN KEY FK_FA651CE96BF700BD');
$this->addSql('DROP TABLE open_port');
}
}