vendor/bluue/shipments-bundle/migrations/Version20230606122809.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace ShipmentsBundleMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. final class Version20230606122809 extends AbstractMigration
  7. {
  8.     public function up(Schema $schema): void
  9.     {
  10.         $this->addSql('CREATE TABLE shipments_bundle__order_state_for_maj_statut (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', order_state_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', statut_name VARCHAR(25) DEFAULT NULL, INDEX IDX_1A80CA2CE420DE70 (order_state_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  11.         $this->addSql('ALTER TABLE shipments_bundle__order_state_for_maj_statut ADD CONSTRAINT FK_1A80CA2CE420DE70 FOREIGN KEY (order_state_id) REFERENCES sales_bundle__order_state (id)');
  12.     }
  13.     public function down(Schema $schema): void
  14.     {
  15.         $this->addSql('ALTER TABLE shipments_bundle__order_state_for_maj_statut DROP FOREIGN KEY FK_1A80CA2CE420DE70');
  16.         $this->addSql('DROP TABLE shipments_bundle__order_state_for_maj_statut');
  17.     }
  18.     public function postUp(Schema $schema): void
  19.     {
  20.         parent::postUp($schema);
  21.         $this->connection->insert('cron_job', [
  22.             'name' => 'shipments-sync-order-statut',
  23.             'command' => 'bluue-bundle:shipments:sync-order-statut',
  24.             'schedule' => '9 * * * *',
  25.             'description' => '',
  26.             'enabled' => 0
  27.         ]);
  28.     }
  29. }