migrations/Version20260115120628.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use App\Entity\Security\RoleInterface;
  5. use Doctrine\DBAL\Schema\Schema;
  6. use Doctrine\Migrations\AbstractMigration;
  7. /**
  8.  * Auto-generated Migration: Please modify to your needs!
  9.  */
  10. final class Version20260115120628 extends AbstractMigration
  11. {
  12.     public function getDescription(): string
  13.     {
  14.         return 'Add ROLE_DEVELOPER to the role table';
  15.     }
  16.     public function up(Schema $schema): void
  17.     {
  18.         $this->addSql(sprintf(
  19.             "INSERT INTO role (name, role, importance, enabled) VALUES ('Développeur', '%s', 5, 1)",
  20.             RoleInterface::ROLE_DEVELOPER
  21.         ));
  22.     }
  23.     public function down(Schema $schema): void
  24.     {
  25.         $this->addSql(sprintf(
  26.             "DELETE FROM role WHERE role = '%s'",
  27.             RoleInterface::ROLE_DEVELOPER
  28.         ));
  29.     }
  30. }