vendor/bluue/crm-bundle/migrations/Version20240724133929.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace CrmBundleMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. final class Version20240724133929 extends AbstractMigration
  7. {
  8.     public function up(Schema $schema): void
  9.     {
  10.         $this->addSql('ALTER TABLE crm_bundle__opportunity_state ADD is_lost TINYINT(1) DEFAULT 0');
  11.     }
  12.     public function postUp(Schema $schema): void
  13.     {
  14.         $this->connection->insert('cron_job', [
  15.             'name' => 'crm:auto-loss-opportunity',
  16.             'command' => 'bluue-bundle:crm:auto-loss-opportunity',
  17.             'schedule' => '0 4 * * *',
  18.             'description' => '',
  19.             'enabled' => 1
  20.         ]);
  21.     }
  22.     public function down(Schema $schema): void
  23.     {
  24.         $this->addSql('ALTER TABLE crm_bundle__opportunity_state DROP is_lost');
  25.     }
  26. }