<?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 Version20250114110908 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 inventory_stock_movement ADD invoice_id INT DEFAULT NULL, ADD supplier_shipping_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE inventory_stock_movement ADD CONSTRAINT FK_1A8FA732989F1FD FOREIGN KEY (invoice_id) REFERENCES invoice (id)');
$this->addSql('ALTER TABLE inventory_stock_movement ADD CONSTRAINT FK_1A8FA73913058E9 FOREIGN KEY (supplier_shipping_id) REFERENCES supplier_shipping (id)');
$this->addSql('CREATE INDEX IDX_1A8FA732989F1FD ON inventory_stock_movement (invoice_id)');
$this->addSql('CREATE INDEX IDX_1A8FA73913058E9 ON inventory_stock_movement (supplier_shipping_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE inventory_stock_movement DROP FOREIGN KEY FK_1A8FA732989F1FD');
$this->addSql('ALTER TABLE inventory_stock_movement DROP FOREIGN KEY FK_1A8FA73913058E9');
$this->addSql('DROP INDEX IDX_1A8FA732989F1FD ON inventory_stock_movement');
$this->addSql('DROP INDEX IDX_1A8FA73913058E9 ON inventory_stock_movement');
$this->addSql('ALTER TABLE inventory_stock_movement DROP invoice_id, DROP supplier_shipping_id');
}
}