<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Types\Types;
use Doctrine\Migrations\AbstractMigration;
final class Version20221121173543 extends AbstractMigration
{
public function getDescription(): string
{
return 'Changes the avatar_image_url fields to text in company_user, health_mutual_user, mycmcm_user, public_api_user tables!';
}
public function up(Schema $schema): void
{
$this->skipIf(
$schema->getTable('company_user')->getColumn('avatar_image_url')->getType() === Type::getType(Types::TEXT),
'The company_user table\'s avatar_image_url field was already converted to text type!'
);
$schema->getTable('company_user')->getColumn('avatar_image_url')->setType(Type::getType(Types::TEXT));
$schema->getTable('health_mutual_user')->getColumn('avatar_image_url')->setType(Type::getType(Types::TEXT));
$schema->getTable('mycmcm_user')->getColumn('avatar_image_url')->setType(Type::getType(Types::TEXT));
$schema->getTable('public_api_user')->getColumn('avatar_image_url')->setType(Type::getType(Types::TEXT));
}
public function down(Schema $schema): void
{
}
}