<?php
declare(strict_types=1);
namespace CoreMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20230710072735 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 cash_register_bundle__receipt ADD invoice_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE cash_register_bundle__receipt ADD CONSTRAINT FK_792CC4B62989F1FD FOREIGN KEY (invoice_id) REFERENCES sales_bundle__invoice (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_792CC4B62989F1FD ON cash_register_bundle__receipt (invoice_id)');
$this->addSql('ALTER TABLE sales_bundle__order_line ADD stock_reserved TINYINT(1) DEFAULT 0 NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE cash_register_bundle__receipt DROP FOREIGN KEY FK_792CC4B62989F1FD');
$this->addSql('DROP INDEX UNIQ_792CC4B62989F1FD ON cash_register_bundle__receipt');
$this->addSql('ALTER TABLE cash_register_bundle__receipt DROP invoice_id');
$this->addSql('ALTER TABLE sales_bundle__order_line DROP stock_reserved');
}
}