<?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 Version20231006054131 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 order_eshop_item (id INT AUTO_INCREMENT NOT NULL, product_id INT NOT NULL, order_eshop_id INT NOT NULL, name VARCHAR(255) NOT NULL, count INT DEFAULT NULL, vat DOUBLE PRECISION DEFAULT NULL, price_excl_vat DOUBLE PRECISION DEFAULT NULL, price_vat DOUBLE PRECISION DEFAULT NULL, price_incl_vat DOUBLE PRECISION DEFAULT NULL, total_price_excl_vat DOUBLE PRECISION DEFAULT NULL, total_price_vat DOUBLE PRECISION DEFAULT NULL, total_price_incl_vat DOUBLE PRECISION DEFAULT NULL, INDEX IDX_5F7E8DDC4584665A (product_id), INDEX IDX_5F7E8DDCCCAB88A4 (order_eshop_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE order_eshop_item ADD CONSTRAINT FK_5F7E8DDC4584665A FOREIGN KEY (product_id) REFERENCES product (id)');
$this->addSql('ALTER TABLE order_eshop_item ADD CONSTRAINT FK_5F7E8DDCCCAB88A4 FOREIGN KEY (order_eshop_id) REFERENCES `order` (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE order_eshop_item DROP FOREIGN KEY FK_5F7E8DDC4584665A');
$this->addSql('ALTER TABLE order_eshop_item DROP FOREIGN KEY FK_5F7E8DDCCCAB88A4');
$this->addSql('DROP TABLE order_eshop_item');
}
}