<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20220215153347 extends AbstractMigration
{
public function getDescription(): string
{
return 'New deal properties';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE deal ADD description LONGTEXT NOT NULL, ADD is_app TINYINT(1) NOT NULL, ADD is_location TINYINT(1) NOT NULL, ADD is_online TINYINT(1) NOT NULL, ADD terms LONGTEXT NOT NULL, CHANGE is_active is_website TINYINT(1) NOT NULL');
// Change order a bit.
$this->addSql('ALTER TABLE deal MODIFY url varchar(255) not null after title_sales');
$this->addSql('ALTER TABLE deal MODIFY is_website tinyint(1) not null after drupal_id');
$this->addSql('ALTER TABLE deal MODIFY description longtext not null after allowed_days');
$this->addSql('ALTER TABLE deal MODIFY is_app tinyint(1) not null after is_website');
$this->addSql('ALTER TABLE deal MODIFY is_location tinyint(1) not null after is_app');
$this->addSql('ALTER TABLE deal MODIFY is_online tinyint(1) not null after is_location');
$this->addSql('ALTER TABLE deal MODIFY terms longtext not null after description');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE deal ADD is_active TINYINT(1) NOT NULL, DROP description, DROP is_website, DROP is_app, DROP is_location, DROP is_online, DROP terms');
}
public function isTransactional(): bool
{
return false;
}
}