<?php
declare(strict_types=1);
namespace ProductsBundleMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20230124095539 extends AbstractMigration
{
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE products_bundle__price_rule (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', product_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', declination_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', context_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', currency_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', country_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', created_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', updated_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', deleted_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', from_quantity NUMERIC(20, 2) NOT NULL, new_price NUMERIC(20, 2) DEFAULT NULL, reduction NUMERIC(20, 2) NOT NULL, reduction_tax TINYINT(1) NOT NULL, reduction_type VARCHAR(255) NOT NULL, `date_from` DATETIME DEFAULT NULL, `date_to` DATETIME DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_3C8F79A74584665A (product_id), INDEX IDX_3C8F79A79941A932 (declination_id), INDEX IDX_3C8F79A76B00C1CF (context_id), INDEX IDX_3C8F79A738248176 (currency_id), INDEX IDX_3C8F79A7F92F3E70 (country_id), INDEX IDX_3C8F79A7B03A8386 (created_by_id), INDEX IDX_3C8F79A7896DBBDE (updated_by_id), INDEX IDX_3C8F79A7C76F1F52 (deleted_by_id), INDEX from_quantity (from_quantity), INDEX `date_from` (`date_from`), INDEX `date_to` (`date_to`), INDEX created_at (created_at), INDEX updated_at (updated_at), INDEX deleted_at (deleted_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE products_bundle__price_rule ADD CONSTRAINT FK_3C8F79A74584665A FOREIGN KEY (product_id) REFERENCES products_bundle__product (id)');
$this->addSql('ALTER TABLE products_bundle__price_rule ADD CONSTRAINT FK_3C8F79A79941A932 FOREIGN KEY (declination_id) REFERENCES products_bundle__declination (id)');
$this->addSql('ALTER TABLE products_bundle__price_rule ADD CONSTRAINT FK_3C8F79A76B00C1CF FOREIGN KEY (context_id) REFERENCES context (id)');
$this->addSql('ALTER TABLE products_bundle__price_rule ADD CONSTRAINT FK_3C8F79A738248176 FOREIGN KEY (currency_id) REFERENCES currency (id)');
$this->addSql('ALTER TABLE products_bundle__price_rule ADD CONSTRAINT FK_3C8F79A7F92F3E70 FOREIGN KEY (country_id) REFERENCES country (id)');
$this->addSql('ALTER TABLE products_bundle__price_rule ADD CONSTRAINT FK_3C8F79A7B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE products_bundle__price_rule ADD CONSTRAINT FK_3C8F79A7896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE products_bundle__price_rule ADD CONSTRAINT FK_3C8F79A7C76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
}
public function down(Schema $schema): void
{
$this->addSql('DROP TABLE products_bundle__price_rule');
}
}