<?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 Version20220331145053 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_returns_bundle__product_return (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', context_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', customer_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', order_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', delivery_note_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', state_id BINARY(16) NOT 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)\', reference VARCHAR(128) DEFAULT NULL, reason LONGTEXT DEFAULT NULL, request_date DATE DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_1DBC22896B00C1CF (context_id), INDEX IDX_1DBC22899395C3F3 (customer_id), INDEX IDX_1DBC22898D9F6D38 (order_id), INDEX IDX_1DBC22892CF3B78B (delivery_note_id), INDEX IDX_1DBC22895D83CC1 (state_id), INDEX IDX_1DBC2289B03A8386 (created_by_id), INDEX IDX_1DBC2289896DBBDE (updated_by_id), INDEX IDX_1DBC2289C76F1F52 (deleted_by_id), INDEX created_at (created_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE product_returns_bundle__product_return_line (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', product_return_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', delivery_note_line_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', transformed_order_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', transformed_credit_note_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)\', quantity NUMERIC(20, 6) DEFAULT NULL, back_in_stock TINYINT(1) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_9D41AD34CD4A058 (product_return_id), INDEX IDX_9D41AD3535E48DC (delivery_note_line_id), INDEX IDX_9D41AD32477F688 (transformed_order_id), INDEX IDX_9D41AD365176536 (transformed_credit_note_id), INDEX IDX_9D41AD3B03A8386 (created_by_id), INDEX IDX_9D41AD3896DBBDE (updated_by_id), INDEX IDX_9D41AD3C76F1F52 (deleted_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE product_returns_bundle__return_state (id BINARY(16) NOT 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)\', name VARCHAR(128) NOT NULL, color VARCHAR(7) NOT NULL, text_color VARCHAR(7) NOT NULL, to_transform TINYINT(1) NOT NULL, to_close TINYINT(1) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, is_active TINYINT(1) NOT NULL, is_default TINYINT(1) NOT NULL, INDEX IDX_BE4FE665B03A8386 (created_by_id), INDEX IDX_BE4FE665896DBBDE (updated_by_id), INDEX IDX_BE4FE665C76F1F52 (deleted_by_id), INDEX color (color), INDEX text_color (text_color), INDEX name (name), INDEX to_transform (to_transform), INDEX to_close (to_close), INDEX is_active (is_active), INDEX is_default (is_default), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE product_returns_bundle__return_state_translations (id INT AUTO_INCREMENT NOT NULL, object_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', locale VARCHAR(8) NOT NULL, field VARCHAR(32) NOT NULL, content LONGTEXT DEFAULT NULL, INDEX IDX_FD1721C8232D562B (object_id), UNIQUE INDEX lookup_unique_idx (locale, object_id, field), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE product_returns_bundle__product_return ADD CONSTRAINT FK_1DBC22896B00C1CF FOREIGN KEY (context_id) REFERENCES context (id)');
$this->addSql('ALTER TABLE product_returns_bundle__product_return ADD CONSTRAINT FK_1DBC22899395C3F3 FOREIGN KEY (customer_id) REFERENCES customers_bundle__customer (id)');
$this->addSql('ALTER TABLE product_returns_bundle__product_return ADD CONSTRAINT FK_1DBC22898D9F6D38 FOREIGN KEY (order_id) REFERENCES sales_bundle__order (id)');
$this->addSql('ALTER TABLE product_returns_bundle__product_return ADD CONSTRAINT FK_1DBC22892CF3B78B FOREIGN KEY (delivery_note_id) REFERENCES sales_bundle__delivery_note (id)');
$this->addSql('ALTER TABLE product_returns_bundle__product_return ADD CONSTRAINT FK_1DBC22895D83CC1 FOREIGN KEY (state_id) REFERENCES product_returns_bundle__return_state (id)');
$this->addSql('ALTER TABLE product_returns_bundle__product_return ADD CONSTRAINT FK_1DBC2289B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE product_returns_bundle__product_return ADD CONSTRAINT FK_1DBC2289896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE product_returns_bundle__product_return ADD CONSTRAINT FK_1DBC2289C76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE product_returns_bundle__product_return_line ADD CONSTRAINT FK_9D41AD34CD4A058 FOREIGN KEY (product_return_id) REFERENCES product_returns_bundle__product_return (id)');
$this->addSql('ALTER TABLE product_returns_bundle__product_return_line ADD CONSTRAINT FK_9D41AD3535E48DC FOREIGN KEY (delivery_note_line_id) REFERENCES sales_bundle__delivery_note_line (id)');
$this->addSql('ALTER TABLE product_returns_bundle__product_return_line ADD CONSTRAINT FK_9D41AD32477F688 FOREIGN KEY (transformed_order_id) REFERENCES sales_bundle__order (id)');
$this->addSql('ALTER TABLE product_returns_bundle__product_return_line ADD CONSTRAINT FK_9D41AD365176536 FOREIGN KEY (transformed_credit_note_id) REFERENCES sales_bundle__credit_note (id)');
$this->addSql('ALTER TABLE product_returns_bundle__product_return_line ADD CONSTRAINT FK_9D41AD3B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE product_returns_bundle__product_return_line ADD CONSTRAINT FK_9D41AD3896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE product_returns_bundle__product_return_line ADD CONSTRAINT FK_9D41AD3C76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE product_returns_bundle__return_state ADD CONSTRAINT FK_BE4FE665B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE product_returns_bundle__return_state ADD CONSTRAINT FK_BE4FE665896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE product_returns_bundle__return_state ADD CONSTRAINT FK_BE4FE665C76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE product_returns_bundle__return_state_translations ADD CONSTRAINT FK_FD1721C8232D562B FOREIGN KEY (object_id) REFERENCES product_returns_bundle__return_state (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE currency CHANGE change_rate change_rate NUMERIC(20, 12) DEFAULT \'1\' NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE product_returns_bundle__product_return_line DROP FOREIGN KEY FK_9D41AD34CD4A058');
$this->addSql('ALTER TABLE product_returns_bundle__product_return DROP FOREIGN KEY FK_1DBC22895D83CC1');
$this->addSql('ALTER TABLE product_returns_bundle__return_state_translations DROP FOREIGN KEY FK_FD1721C8232D562B');
$this->addSql('DROP TABLE product_returns_bundle__product_return');
$this->addSql('DROP TABLE product_returns_bundle__product_return_line');
$this->addSql('DROP TABLE product_returns_bundle__return_state');
$this->addSql('DROP TABLE product_returns_bundle__return_state_translations');
$this->addSql('ALTER TABLE currency CHANGE change_rate change_rate NUMERIC(20, 12) DEFAULT \'1.000000000000\' NOT NULL');
}
}