<?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 Version20220624140815 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 stocks_bundle__stock_movement ADD CONSTRAINT FK_11E6623AA145ECC8 FOREIGN KEY (stock_quantity_id) REFERENCES stocks_bundle__stock_quantity (id)');
$this->addSql('ALTER TABLE stocks_bundle__stock_movement ADD CONSTRAINT FK_11E6623A64D218E FOREIGN KEY (location_id) REFERENCES stocks_bundle__location (id)');
$this->addSql('ALTER TABLE stocks_bundle__stock_movement ADD CONSTRAINT FK_11E6623AE3B45410 FOREIGN KEY (sub_location_id) REFERENCES stocks_bundle__sub_location (id)');
$this->addSql('CREATE INDEX IDX_11E6623AA145ECC8 ON stocks_bundle__stock_movement (stock_quantity_id)');
$this->addSql('CREATE INDEX IDX_11E6623A64D218E ON stocks_bundle__stock_movement (location_id)');
$this->addSql('CREATE INDEX IDX_11E6623AE3B45410 ON stocks_bundle__stock_movement (sub_location_id)');
$this->addSql('ALTER TABLE stocks_bundle__stock_order_line ADD CONSTRAINT FK_C168A566EBCD91F6 FOREIGN KEY (stock_product_id) REFERENCES stocks_bundle__stock_product (id)');
$this->addSql('ALTER TABLE stocks_bundle__stock_order_line ADD CONSTRAINT FK_C168A566BB01DC09 FOREIGN KEY (order_line_id) REFERENCES sales_bundle__order_line (id)');
$this->addSql('ALTER TABLE stocks_bundle__stock_order_line ADD CONSTRAINT FK_C168A566B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE stocks_bundle__stock_order_line ADD CONSTRAINT FK_C168A566896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE stocks_bundle__stock_order_line_location ADD CONSTRAINT FK_DF6712FE3F9EF6ED FOREIGN KEY (stock_order_line_id) REFERENCES stocks_bundle__stock_order_line (id)');
$this->addSql('ALTER TABLE stocks_bundle__stock_order_line_location ADD CONSTRAINT FK_DF6712FED98387BA FOREIGN KEY (stock_location_id) REFERENCES stocks_bundle__stock_location (id)');
$this->addSql('ALTER TABLE stocks_bundle__stock_order_line_location ADD CONSTRAINT FK_DF6712FEB03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE stocks_bundle__stock_order_line_location ADD CONSTRAINT FK_DF6712FE896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE stocks_bundle__stock_product ADD CONSTRAINT FK_3D03C4604584665A FOREIGN KEY (product_id) REFERENCES products_bundle__product (id)');
$this->addSql('ALTER TABLE stocks_bundle__stock_product ADD CONSTRAINT FK_3D03C4609941A932 FOREIGN KEY (declination_id) REFERENCES products_bundle__declination (id)');
$this->addSql('ALTER TABLE stocks_bundle__stock_product ADD CONSTRAINT FK_3D03C4605080ECDE FOREIGN KEY (warehouse_id) REFERENCES stocks_bundle__warehouse (id)');
$this->addSql('ALTER TABLE stocks_bundle__stock_product ADD CONSTRAINT FK_3D03C460B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE stocks_bundle__stock_product ADD CONSTRAINT FK_3D03C460896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE stocks_bundle__stock_product ADD CONSTRAINT FK_3D03C460C76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE stocks_bundle__stock_quantity ADD CONSTRAINT FK_7AC8E1FBD98387BA FOREIGN KEY (stock_location_id) REFERENCES stocks_bundle__stock_location (id)');
$this->addSql('ALTER TABLE stocks_bundle__stock_quantity ADD CONSTRAINT FK_7AC8E1FB38248176 FOREIGN KEY (currency_id) REFERENCES currency (id)');
$this->addSql('ALTER TABLE stocks_bundle__stock_quantity ADD CONSTRAINT FK_7AC8E1FBB03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE stocks_bundle__stock_quantity ADD CONSTRAINT FK_7AC8E1FB896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE stocks_bundle__stock_quantity ADD CONSTRAINT FK_7AC8E1FBC76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
$this->addSql('DROP INDEX IDX_2C547A1EDCD6110 ON suppliers_orders_bundle__receipt_note_line');
$this->addSql('ALTER TABLE suppliers_orders_bundle__receipt_note_line ADD date_type_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD date DATETIME DEFAULT NULL, ADD batch_number VARCHAR(255) DEFAULT NULL, CHANGE stock_id stock_location_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE suppliers_orders_bundle__receipt_note_line ADD CONSTRAINT FK_2C547A1ED98387BA FOREIGN KEY (stock_location_id) REFERENCES stocks_bundle__stock_location (id)');
$this->addSql('ALTER TABLE suppliers_orders_bundle__receipt_note_line ADD CONSTRAINT FK_2C547A1EFCAB8B6E FOREIGN KEY (date_type_id) REFERENCES stocks_bundle__date_type (id)');
$this->addSql('CREATE INDEX IDX_2C547A1ED98387BA ON suppliers_orders_bundle__receipt_note_line (stock_location_id)');
$this->addSql('CREATE INDEX IDX_2C547A1EFCAB8B6E ON suppliers_orders_bundle__receipt_note_line (date_type_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE stocks_bundle__stock_movement DROP FOREIGN KEY FK_11E6623AA145ECC8');
$this->addSql('ALTER TABLE stocks_bundle__stock_movement DROP FOREIGN KEY FK_11E6623A64D218E');
$this->addSql('ALTER TABLE stocks_bundle__stock_movement DROP FOREIGN KEY FK_11E6623AE3B45410');
$this->addSql('DROP INDEX IDX_11E6623AA145ECC8 ON stocks_bundle__stock_movement');
$this->addSql('DROP INDEX IDX_11E6623A64D218E ON stocks_bundle__stock_movement');
$this->addSql('DROP INDEX IDX_11E6623AE3B45410 ON stocks_bundle__stock_movement');
$this->addSql('ALTER TABLE stocks_bundle__stock_order_line DROP FOREIGN KEY FK_C168A566EBCD91F6');
$this->addSql('ALTER TABLE stocks_bundle__stock_order_line DROP FOREIGN KEY FK_C168A566BB01DC09');
$this->addSql('ALTER TABLE stocks_bundle__stock_order_line DROP FOREIGN KEY FK_C168A566B03A8386');
$this->addSql('ALTER TABLE stocks_bundle__stock_order_line DROP FOREIGN KEY FK_C168A566896DBBDE');
$this->addSql('ALTER TABLE stocks_bundle__stock_order_line_location DROP FOREIGN KEY FK_DF6712FE3F9EF6ED');
$this->addSql('ALTER TABLE stocks_bundle__stock_order_line_location DROP FOREIGN KEY FK_DF6712FED98387BA');
$this->addSql('ALTER TABLE stocks_bundle__stock_order_line_location DROP FOREIGN KEY FK_DF6712FEB03A8386');
$this->addSql('ALTER TABLE stocks_bundle__stock_order_line_location DROP FOREIGN KEY FK_DF6712FE896DBBDE');
$this->addSql('ALTER TABLE stocks_bundle__stock_product DROP FOREIGN KEY FK_3D03C4604584665A');
$this->addSql('ALTER TABLE stocks_bundle__stock_product DROP FOREIGN KEY FK_3D03C4609941A932');
$this->addSql('ALTER TABLE stocks_bundle__stock_product DROP FOREIGN KEY FK_3D03C4605080ECDE');
$this->addSql('ALTER TABLE stocks_bundle__stock_product DROP FOREIGN KEY FK_3D03C460B03A8386');
$this->addSql('ALTER TABLE stocks_bundle__stock_product DROP FOREIGN KEY FK_3D03C460896DBBDE');
$this->addSql('ALTER TABLE stocks_bundle__stock_product DROP FOREIGN KEY FK_3D03C460C76F1F52');
$this->addSql('ALTER TABLE stocks_bundle__stock_quantity DROP FOREIGN KEY FK_7AC8E1FBD98387BA');
$this->addSql('ALTER TABLE stocks_bundle__stock_quantity DROP FOREIGN KEY FK_7AC8E1FB38248176');
$this->addSql('ALTER TABLE stocks_bundle__stock_quantity DROP FOREIGN KEY FK_7AC8E1FBB03A8386');
$this->addSql('ALTER TABLE stocks_bundle__stock_quantity DROP FOREIGN KEY FK_7AC8E1FB896DBBDE');
$this->addSql('ALTER TABLE stocks_bundle__stock_quantity DROP FOREIGN KEY FK_7AC8E1FBC76F1F52');
$this->addSql('ALTER TABLE suppliers_orders_bundle__receipt_note_line DROP FOREIGN KEY FK_2C547A1ED98387BA');
$this->addSql('ALTER TABLE suppliers_orders_bundle__receipt_note_line DROP FOREIGN KEY FK_2C547A1EFCAB8B6E');
$this->addSql('DROP INDEX IDX_2C547A1ED98387BA ON suppliers_orders_bundle__receipt_note_line');
$this->addSql('DROP INDEX IDX_2C547A1EFCAB8B6E ON suppliers_orders_bundle__receipt_note_line');
$this->addSql('ALTER TABLE suppliers_orders_bundle__receipt_note_line ADD stock_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', DROP stock_location_id, DROP date_type_id, DROP date, DROP batch_number');
$this->addSql('CREATE INDEX IDX_2C547A1EDCD6110 ON suppliers_orders_bundle__receipt_note_line (stock_id)');
}
}