<?php
declare(strict_types=1);
namespace CrmBundleMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20240724133929 extends AbstractMigration
{
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE crm_bundle__opportunity_state ADD is_lost TINYINT(1) DEFAULT 0');
}
public function postUp(Schema $schema): void
{
$this->connection->insert('cron_job', [
'name' => 'crm:auto-loss-opportunity',
'command' => 'bluue-bundle:crm:auto-loss-opportunity',
'schedule' => '0 4 * * *',
'description' => '',
'enabled' => 1
]);
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE crm_bundle__opportunity_state DROP is_lost');
}
}