app/DoctrineMigrations/Version20250805030013.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20250805030013 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         $table $schema->getTable('dtb_category');
  18.         if (!$table->hasColumn('is_searchable')) {
  19.             $this->addSql("ALTER TABLE dtb_category ADD is_searchable SMALLINT DEFAULT 0 NOT NULL");
  20.         }
  21.     }
  22.     
  23.     public function down(Schema $schema): void
  24.     {
  25.         $table $schema->getTable('dtb_category');
  26.         if ($table->hasColumn('is_searchable')) {
  27.             $this->addSql("ALTER TABLE dtb_category DROP COLUMN is_searchable");
  28.         }
  29.     }
  30.     
  31. }