migrations/Version20250707125644.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.  * Migration: Add is_loyal column to Contact table
  8.  * 
  9.  * This migration adds the missing is_loyal column that is required
  10.  * for the Contact entity before running the privatisation data migration.
  11.  */
  12. final class Version20250707125644 extends AbstractMigration
  13. {
  14.     public function getDescription(): string
  15.     {
  16.         return 'Add is_loyal column to Contact table';
  17.     }
  18.     public function up(Schema $schema): void
  19.     {
  20.         // Add is_loyal column to contact table
  21.         $this->addSql('ALTER TABLE contact ADD is_loyal TINYINT(1) DEFAULT 0 NOT NULL');
  22.     }
  23.     public function down(Schema $schema): void
  24.     {
  25.         // Remove is_loyal column
  26.         $this->addSql('ALTER TABLE contact DROP is_loyal');
  27.     }
  28. }