migrations/Version20220507174557.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 Version20220507174557 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->addSql('CREATE TABLE settings (id VARCHAR(255) NOT NULL, statistics_collection_hours INT NOT NULL, accept_campaign_only_verified_users TINYINT(1) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('ALTER TABLE campaign DROP only_verified_creators');
  20.         $this->addSql('INSERT INTO settings (id, statistics_collection_hours, accept_campaign_only_verified_users) VALUES (:id, :hours, :verified)', [
  21.             'id' => 'common',
  22.             'hours' => 72,
  23.             'verified' => 0,
  24.         ]);
  25.     }
  26.     public function down(Schema $schema): void
  27.     {
  28.         // this down() migration is auto-generated, please modify it to your needs
  29.         $this->addSql('DROP TABLE settings');
  30.         $this->addSql('ALTER TABLE campaign ADD only_verified_creators TINYINT(1) DEFAULT 0 NOT NULL');
  31.     }
  32.     public function isTransactional(): bool
  33.     {
  34.         return false;
  35.     }
  36. }