migrations/Version20240829112320.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.  * Migration add credit for sponsor
  8.  */
  9. final class Version20240829112320 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return 'Migration add credit for sponsor';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         $this->addSql("
  18.             ALTER TABLE `sponsor`
  19.                 ADD `credit` TINYINT(1) DEFAULT 0 NOT NULL,
  20.                 ADD `credit_limit` DOUBLE PRECISION DEFAULT '0' NOT NULL;
  21.         ");
  22.     }
  23.     public function down(Schema $schema): void
  24.     {
  25.         $this->addSql('
  26.             ALTER TABLE `sponsor`
  27.                 DROP `credit`,
  28.                 DROP `credit_limit`;
  29.         ');
  30.     }
  31. }