<?php
declare(strict_types=1);
namespace SuppliersOrdersBundleMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20240719123445 extends AbstractMigration
{
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE suppliers_orders_bundle__import_order (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', file_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', context_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', supplier_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)\', number INT NOT NULL, status_name VARCHAR(50) DEFAULT NULL, nb_lines_success INT DEFAULT NULL, nb_lines_error INT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_3CCEE5EF93CB796C (file_id), INDEX IDX_3CCEE5EF6B00C1CF (context_id), INDEX IDX_3CCEE5EF2ADD6D8C (supplier_id), INDEX IDX_3CCEE5EFB03A8386 (created_by_id), INDEX IDX_3CCEE5EF896DBBDE (updated_by_id), INDEX IDX_3CCEE5EFC76F1F52 (deleted_by_id), INDEX status_name (status_name), INDEX nb_lines_success (nb_lines_success), INDEX nb_lines_error (nb_lines_error), INDEX deleted_at (deleted_at), INDEX created_at (created_at), INDEX updated_at (updated_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE suppliers_orders_bundle__import_order_error (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', import_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)\', description LONGTEXT NOT NULL, options JSON NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_6B2034D4B6A263D9 (import_id), INDEX IDX_6B2034D4B03A8386 (created_by_id), INDEX IDX_6B2034D4896DBBDE (updated_by_id), INDEX IDX_6B2034D4C76F1F52 (deleted_by_id), INDEX deleted_at (deleted_at), INDEX created_at (created_at), INDEX updated_at (updated_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE suppliers_orders_bundle__import_order ADD CONSTRAINT FK_3CCEE5EF93CB796C FOREIGN KEY (file_id) REFERENCES file_manager (id)');
$this->addSql('ALTER TABLE suppliers_orders_bundle__import_order ADD CONSTRAINT FK_3CCEE5EF6B00C1CF FOREIGN KEY (context_id) REFERENCES context (id)');
$this->addSql('ALTER TABLE suppliers_orders_bundle__import_order ADD CONSTRAINT FK_3CCEE5EF2ADD6D8C FOREIGN KEY (supplier_id) REFERENCES suppliers_bundle__supplier (id)');
$this->addSql('ALTER TABLE suppliers_orders_bundle__import_order ADD CONSTRAINT FK_3CCEE5EFB03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE suppliers_orders_bundle__import_order ADD CONSTRAINT FK_3CCEE5EF896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE suppliers_orders_bundle__import_order ADD CONSTRAINT FK_3CCEE5EFC76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE suppliers_orders_bundle__import_order_error ADD CONSTRAINT FK_6B2034D4B6A263D9 FOREIGN KEY (import_id) REFERENCES suppliers_orders_bundle__import_order (id)');
$this->addSql('ALTER TABLE suppliers_orders_bundle__import_order_error ADD CONSTRAINT FK_6B2034D4B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE suppliers_orders_bundle__import_order_error ADD CONSTRAINT FK_6B2034D4896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE suppliers_orders_bundle__import_order_error ADD CONSTRAINT FK_6B2034D4C76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE suppliers_orders_bundle__import_order DROP FOREIGN KEY FK_3CCEE5EF93CB796C');
$this->addSql('ALTER TABLE suppliers_orders_bundle__import_order DROP FOREIGN KEY FK_3CCEE5EF6B00C1CF');
$this->addSql('ALTER TABLE suppliers_orders_bundle__import_order DROP FOREIGN KEY FK_3CCEE5EF2ADD6D8C');
$this->addSql('ALTER TABLE suppliers_orders_bundle__import_order DROP FOREIGN KEY FK_3CCEE5EFB03A8386');
$this->addSql('ALTER TABLE suppliers_orders_bundle__import_order DROP FOREIGN KEY FK_3CCEE5EF896DBBDE');
$this->addSql('ALTER TABLE suppliers_orders_bundle__import_order DROP FOREIGN KEY FK_3CCEE5EFC76F1F52');
$this->addSql('ALTER TABLE suppliers_orders_bundle__import_order_error DROP FOREIGN KEY FK_6B2034D4B6A263D9');
$this->addSql('ALTER TABLE suppliers_orders_bundle__import_order_error DROP FOREIGN KEY FK_6B2034D4B03A8386');
$this->addSql('ALTER TABLE suppliers_orders_bundle__import_order_error DROP FOREIGN KEY FK_6B2034D4896DBBDE');
$this->addSql('ALTER TABLE suppliers_orders_bundle__import_order_error DROP FOREIGN KEY FK_6B2034D4C76F1F52');
$this->addSql('DROP TABLE suppliers_orders_bundle__import_order');
$this->addSql('DROP TABLE suppliers_orders_bundle__import_order_error');
}
}