<?php
declare(strict_types=1);
namespace ShipmentsBundleMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20230606122809 extends AbstractMigration
{
public function up(Schema $schema): void
{
$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');
$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)');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE shipments_bundle__order_state_for_maj_statut DROP FOREIGN KEY FK_1A80CA2CE420DE70');
$this->addSql('DROP TABLE shipments_bundle__order_state_for_maj_statut');
}
public function postUp(Schema $schema): void
{
parent::postUp($schema);
$this->connection->insert('cron_job', [
'name' => 'shipments-sync-order-statut',
'command' => 'bluue-bundle:shipments:sync-order-statut',
'schedule' => '9 * * * *',
'description' => '',
'enabled' => 0
]);
}
}