migrations/Version20251112103000.php line 1

  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Ajoute la colonne prestations dans user_web_conf pour stocker les permissions:
  8.  * 1=Telephone, 2=QuestionsMail, 4=Chat, 8=Visio
  9.  */
  10. final class Version20251112103000 extends AbstractMigration
  11. {
  12.     public function getDescription(): string
  13.     {
  14.         return "Ajout de la colonne prestations (bitfield) dans user_web_conf";
  15.     }
  16.     public function up(Schema $schema): void
  17.     {
  18.         $this->addSql(<<<'SQL'
  19.             ALTER TABLE user_web_conf
  20.             ADD prestations SMALLINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'permissions prestations: 1=Telephone,2=QuestionsMail,4=Chat,8=Visio'
  21.         SQL);
  22.     }
  23.     public function down(Schema $schema): void
  24.     {
  25.         $this->addSql(<<<'SQL'
  26.             ALTER TABLE user_web_conf
  27.             DROP COLUMN prestations
  28.         SQL);
  29.     }
  30.     public function isTransactional(): bool
  31.     {
  32.         return true;
  33.     }
  34. }