vendor/bluue/suppliers-orders-bundle/migrations/Version20240719123445.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace SuppliersOrdersBundleMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. final class Version20240719123445 extends AbstractMigration
  7. {
  8.     public function up(Schema $schema): void
  9.     {
  10.         $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');
  11.         $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');
  12.         $this->addSql('ALTER TABLE suppliers_orders_bundle__import_order ADD CONSTRAINT FK_3CCEE5EF93CB796C FOREIGN KEY (file_id) REFERENCES file_manager (id)');
  13.         $this->addSql('ALTER TABLE suppliers_orders_bundle__import_order ADD CONSTRAINT FK_3CCEE5EF6B00C1CF FOREIGN KEY (context_id) REFERENCES context (id)');
  14.         $this->addSql('ALTER TABLE suppliers_orders_bundle__import_order ADD CONSTRAINT FK_3CCEE5EF2ADD6D8C FOREIGN KEY (supplier_id) REFERENCES suppliers_bundle__supplier (id)');
  15.         $this->addSql('ALTER TABLE suppliers_orders_bundle__import_order ADD CONSTRAINT FK_3CCEE5EFB03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
  16.         $this->addSql('ALTER TABLE suppliers_orders_bundle__import_order ADD CONSTRAINT FK_3CCEE5EF896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
  17.         $this->addSql('ALTER TABLE suppliers_orders_bundle__import_order ADD CONSTRAINT FK_3CCEE5EFC76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
  18.         $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)');
  19.         $this->addSql('ALTER TABLE suppliers_orders_bundle__import_order_error ADD CONSTRAINT FK_6B2034D4B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
  20.         $this->addSql('ALTER TABLE suppliers_orders_bundle__import_order_error ADD CONSTRAINT FK_6B2034D4896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
  21.         $this->addSql('ALTER TABLE suppliers_orders_bundle__import_order_error ADD CONSTRAINT FK_6B2034D4C76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
  22.     }
  23.     public function down(Schema $schema): void
  24.     {
  25.         $this->addSql('ALTER TABLE suppliers_orders_bundle__import_order DROP FOREIGN KEY FK_3CCEE5EF93CB796C');
  26.         $this->addSql('ALTER TABLE suppliers_orders_bundle__import_order DROP FOREIGN KEY FK_3CCEE5EF6B00C1CF');
  27.         $this->addSql('ALTER TABLE suppliers_orders_bundle__import_order DROP FOREIGN KEY FK_3CCEE5EF2ADD6D8C');
  28.         $this->addSql('ALTER TABLE suppliers_orders_bundle__import_order DROP FOREIGN KEY FK_3CCEE5EFB03A8386');
  29.         $this->addSql('ALTER TABLE suppliers_orders_bundle__import_order DROP FOREIGN KEY FK_3CCEE5EF896DBBDE');
  30.         $this->addSql('ALTER TABLE suppliers_orders_bundle__import_order DROP FOREIGN KEY FK_3CCEE5EFC76F1F52');
  31.         $this->addSql('ALTER TABLE suppliers_orders_bundle__import_order_error DROP FOREIGN KEY FK_6B2034D4B6A263D9');
  32.         $this->addSql('ALTER TABLE suppliers_orders_bundle__import_order_error DROP FOREIGN KEY FK_6B2034D4B03A8386');
  33.         $this->addSql('ALTER TABLE suppliers_orders_bundle__import_order_error DROP FOREIGN KEY FK_6B2034D4896DBBDE');
  34.         $this->addSql('ALTER TABLE suppliers_orders_bundle__import_order_error DROP FOREIGN KEY FK_6B2034D4C76F1F52');
  35.         $this->addSql('DROP TABLE suppliers_orders_bundle__import_order');
  36.         $this->addSql('DROP TABLE suppliers_orders_bundle__import_order_error');
  37.     }
  38. }