<?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 Version20230213125528 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 box_type (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, code VARCHAR(255) NOT NULL, is_active TINYINT(1) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE customer_quotations ADD box_type_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE customer_quotations ADD CONSTRAINT FK_543D8A2CDC8E12A2 FOREIGN KEY (box_type_id) REFERENCES box_type (id)');
$this->addSql('CREATE INDEX IDX_543D8A2CDC8E12A2 ON customer_quotations (box_type_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE customer_quotations DROP FOREIGN KEY FK_543D8A2CDC8E12A2');
$this->addSql('DROP TABLE box_type');
$this->addSql('DROP INDEX IDX_543D8A2CDC8E12A2 ON customer_quotations');
$this->addSql('ALTER TABLE customer_quotations DROP box_type_id');
}
}