vendor/bluue/crm-bundle/migrations/Version20240903110340.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 Version20240903110340 extends AbstractMigration
  7. {
  8.     public function up(Schema $schema): void
  9.     {
  10.         $this->addSql('ALTER TABLE crm_bundle__opportunity_state ADD closed TINYINT(1) DEFAULT 0');
  11.         $this->addSql('CREATE INDEX is_lost ON crm_bundle__opportunity_state (is_lost)');
  12.         $this->addSql('CREATE INDEX closed ON crm_bundle__opportunity_state (closed)');
  13.     }
  14.     public function down(Schema $schema): void
  15.     {
  16.         $this->addSql('DROP INDEX is_lost ON crm_bundle__opportunity_state');
  17.         $this->addSql('DROP INDEX closed ON crm_bundle__opportunity_state');
  18.         $this->addSql('ALTER TABLE crm_bundle__opportunity_state DROP closed');
  19.     }
  20. }