migrations/Version20251125192929.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use App\DBAL\Types\UserGroupType;
  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 Version20251125192929 extends AbstractMigration
  11. {
  12.     private const SALES_MANAGERS 5;
  13.     private const RESOLUTION_MANAGERS 9;
  14.     public function getDescription(): string
  15.     {
  16.         return '';
  17.     }
  18.     public function up(Schema $schema): void
  19.     {
  20.         // this up() migration is auto-generated, please modify it to your needs
  21.         $this->addSql(
  22.             'UPDATE user_group SET permissions = :permissions WHERE id = :id',
  23.             [
  24.                 'id' => self::SALES_MANAGERS,
  25.                 'permissions' => serialize([UserGroupType::SALES_ASSOCIATES]),
  26.             ]
  27.         );
  28.         $this->addSql(sprintf('UPDATE user_group SET permissions = NULL WHERE id = %d'self::RESOLUTION_MANAGERS));
  29.     }
  30.     public function down(Schema $schema): void
  31.     {
  32.         // this down() migration is auto-generated, please modify it to your needs
  33.         $this->addSql(
  34.             'UPDATE user_group SET permissions = :permissions WHERE id = :id',
  35.             [
  36.                 'permissions' => serialize(['sales_managers']),
  37.                 'id' => self::SALES_MANAGERS,
  38.             ]
  39.         );
  40.         $this->addSql(
  41.             'UPDATE user_group SET permissions = :permissions WHERE id = :id',
  42.             [
  43.                 'permissions' => serialize(['resolution_managers']),
  44.                 'id' => self::RESOLUTION_MANAGERS,
  45.             ]
  46.         );
  47.     }
  48. }