<?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 Version20230812142044 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 product_related (product_source INT NOT NULL, product_target INT NOT NULL, INDEX IDX_2931F1D3DF63ED7 (product_source), INDEX IDX_2931F1D24136E58 (product_target), PRIMARY KEY(product_source, product_target)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE product_related ADD CONSTRAINT FK_2931F1D3DF63ED7 FOREIGN KEY (product_source) REFERENCES product (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE product_related ADD CONSTRAINT FK_2931F1D24136E58 FOREIGN KEY (product_target) REFERENCES product (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE product ADD material VARCHAR(255) DEFAULT NULL, ADD margin DOUBLE PRECISION DEFAULT NULL, ADD short_desc VARCHAR(500) DEFAULT NULL, ADD long_desc LONGTEXT DEFAULT NULL, ADD vat DOUBLE PRECISION DEFAULT NULL');
$this->addSql("INSERT INTO `parameter` (`code`, `name`, `type`, `product_type`, `sort_order`, `created`, `changed`) VALUES ('weight', 'Hmotnost', 'option', 'metal', '15', now(), now());");
$this->addSql("INSERT INTO `parameter` (`code`, `name`, `type`, `product_type`, `sort_order`, `created`, `changed`) VALUES ('purity', 'Ryzost', 'text', 'metal', '20', now(), now());");
$this->addSql("INSERT INTO `parameter` (`code`, `name`, `type`, `product_type`, `sort_order`, `created`, `changed`) VALUES ('size', 'Velikost', 'text', 'metal', '25', now(), now());");
$this->addSql("INSERT INTO `parameter` (`code`, `name`, `type`, `product_type`, `sort_order`, `created`, `changed`) VALUES ('quality', 'Kvalita', 'text', 'metal', '30', now(), now());");
$this->addSql("INSERT INTO `parameter` (`code`, `name`, `type`, `product_type`, `sort_order`, `created`, `changed`) VALUES ('nominal', 'Nominální hodnota', 'number', 'metal', '35', now(), now());");
$this->addSql("INSERT INTO `parameter` (`code`, `name`, `type`, `product_type`, `sort_order`, `created`, `changed`) VALUES ('emissionLoad', 'Emisní náklad', 'text', 'metal', '40', now(), now());");
$this->addSql("INSERT INTO `parameter` (`code`, `name`, `type`, `product_type`, `sort_order`, `created`, `changed`) VALUES ('foundry', 'Slévárna/Mincovna', 'text', 'metal', '45', now(), now());");
$this->addSql("INSERT INTO `parameter` (`code`, `name`, `type`, `product_type`, `sort_order`, `created`, `changed`) VALUES ('issuer', 'Emitent', 'text', 'metal', '50', now(), now());");
$this->addSql("INSERT INTO `parameter` (`code`, `name`, `type`, `product_type`, `sort_order`, `created`, `changed`) VALUES ('year', 'Rok emise', 'text', 'metal', '55', now(), now());");
$this->addSql("INSERT INTO `parameter` (`code`, `name`, `type`, `product_type`, `sort_order`, `created`, `changed`) VALUES ('packaging', 'Balení', 'text', 'metal', '60', now(), now());");
$this->addSql("INSERT INTO `parameter` (`code`, `name`, `type`, `product_type`, `sort_order`, `created`, `changed`) VALUES ('category', 'Kategorie produktu', 'option', 'metal', '65', now(), now());");
$this->addSql("INSERT INTO `parameter` (`code`, `name`, `type`, `product_type`, `sort_order`, `created`, `changed`) VALUES ('processing', 'Zpracování', 'option', 'metal', '70', now(), now());");
$this->addSql("INSERT INTO `parameter` (`code`, `name`, `type`, `product_type`, `sort_order`, `created`, `changed`) VALUES ('deliveryDate', 'Datum dodání', 'date', 'metal', '75', now(), now());");
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE product_related DROP FOREIGN KEY FK_2931F1D3DF63ED7');
$this->addSql('ALTER TABLE product_related DROP FOREIGN KEY FK_2931F1D24136E58');
$this->addSql('DROP TABLE product_related');
$this->addSql('ALTER TABLE product DROP vat, DROP material, DROP margin, DROP short_desc, DROP long_desc');
}
}