migrations/Version20251125181037.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. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20251125181037 extends AbstractMigration
  10. {
  11.     private const ADMINISTRATORS 1;
  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 ADD allow_paid_transactions TINYINT(1) NOT NULL');
  21.         $this->addSql('ALTER TABLE user_group ADD allow_paid_transactions TINYINT(1) NOT NULL');
  22.         $this->addSql(sprintf('UPDATE user_group SET permissions = NULL WHERE id = %d'self::ADMINISTRATORS));
  23.         $this->addSql(sprintf('UPDATE user_group SET permissions = NULL, allow_paid_transactions = 1 WHERE id = %d'self::PAYMENT_PROS));
  24.     }
  25.     public function down(Schema $schema): void
  26.     {
  27.         // this down() migration is auto-generated, please modify it to your needs
  28.         $this->addSql('ALTER TABLE user DROP allow_paid_transactions');
  29.         $this->addSql('ALTER TABLE user_group DROP allow_paid_transactions');
  30.     }
  31. }