migrations/Version20260223120000.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. final class Version20260223120000 extends AbstractMigration
  7. {
  8.     public function getDescription(): string
  9.     {
  10.         return 'Add beneficiaire effectif fields to president table';
  11.     }
  12.     public function up(Schema $schema): void
  13.     {
  14.         $this->addSql('ALTER TABLE president
  15.             ADD exercice_decisions_assemblees TINYINT(1) DEFAULT NULL,
  16.             ADD exercice_pouvoir_nommer TINYINT(1) DEFAULT NULL,
  17.             ADD detention_capital_ou_vote TINYINT(1) DEFAULT NULL,
  18.             ADD detention_capital_oui TINYINT(1) DEFAULT NULL,
  19.             ADD pourcentage_capital NUMERIC(5,2) DEFAULT NULL,
  20.             ADD detention_capital_directe TINYINT(1) DEFAULT NULL,
  21.             ADD detention_capital_indirecte TINYINT(1) DEFAULT NULL,
  22.             ADD detention_vote_oui TINYINT(1) DEFAULT NULL,
  23.             ADD pourcentage_vote NUMERIC(5,2) DEFAULT NULL,
  24.             ADD detention_vote_directe TINYINT(1) DEFAULT NULL,
  25.             ADD detention_vote_indirecte TINYINT(1) DEFAULT NULL');
  26.     }
  27.     public function down(Schema $schema): void
  28.     {
  29.         $this->addSql('ALTER TABLE president
  30.             DROP exercice_decisions_assemblees,
  31.             DROP exercice_pouvoir_nommer,
  32.             DROP detention_capital_ou_vote,
  33.             DROP detention_capital_oui,
  34.             DROP pourcentage_capital,
  35.             DROP detention_capital_directe,
  36.             DROP detention_capital_indirecte,
  37.             DROP detention_vote_oui,
  38.             DROP pourcentage_vote,
  39.             DROP detention_vote_directe,
  40.             DROP detention_vote_indirecte');
  41.     }
  42. }