migrations/Version20251201165702.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 Version20251201165702 extends AbstractMigration
  11. {
  12.     private const PAYMENT_PROS 7;
  13.     public function getDescription(): string
  14.     {
  15.         return '';
  16.     }
  17.     public function up(Schema $schema): void
  18.     {
  19.         // this up() migration is auto-generated, please modify it to your needs
  20.         $this->addSql('ALTER TABLE user_group DROP allow_paid_transactions');
  21.         $this->addSql(
  22.             'UPDATE user_group SET permissions = :permissions WHERE id = :id',
  23.             [
  24.                 'id' => self::PAYMENT_PROS,
  25.                 'permissions' => serialize([UserGroupType::PAYMENT_PROS]),
  26.             ]
  27.         );
  28.     }
  29.     public function down(Schema $schema): void
  30.     {
  31.         // this down() migration is auto-generated, please modify it to your needs
  32.         $this->addSql('ALTER TABLE user_group ADD allow_paid_transactions TINYINT(1) NOT NULL');
  33.     }
  34. }