<?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 Version20221020084532 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('ALTER TABLE order_detail ADD supplier_id INT DEFAULT NULL, ADD reference VARCHAR(255) DEFAULT NULL, ADD price INT DEFAULT NULL, ADD date DATE DEFAULT NULL COMMENT \'(DC2Type:date_immutable)\'');
$this->addSql('ALTER TABLE order_detail ADD CONSTRAINT FK_ED896F462ADD6D8C FOREIGN KEY (supplier_id) REFERENCES company (id)');
$this->addSql('CREATE INDEX IDX_ED896F462ADD6D8C ON order_detail (supplier_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F462ADD6D8C');
$this->addSql('DROP INDEX IDX_ED896F462ADD6D8C ON order_detail');
$this->addSql('ALTER TABLE order_detail DROP supplier_id, DROP reference, DROP price, DROP date');
}
}