<?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 Version20250213101333 extends AbstractMigration
{
public function isTransactional(): bool
{
return false;
}
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE channel_user_data ADD is_learner INT DEFAULT 1 NOT NULL, ADD is_active TINYINT(1) DEFAULT 1 NOT NULL');
$this->addSql('UPDATE channel_user_data SET is_learner = 0 WHERE channel_user_data.role != 0');
$this->addSql('ALTER TABLE channel_user_data DROP role');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE channel_user_data ADD role INT DEFAULT 0 NOT NULL, DROP is_learner, DROP is_active');
}
}