<?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 Version20251122135555 extends AbstractMigration
{
/**
* @return string
*/
public function getDescription() : string
{
return 'Add recipe brand column';
}
/**
* @param Schema $schema
*
* @throws \Doctrine\DBAL\DBALException
*/
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('ALTER TABLE recipes ADD brand TEXT DEFAULT \'\'');
$this->addSql('COMMENT ON COLUMN recipes.brand IS \'Recipe brand.\'');
$this->addSql('ALTER TABLE customers ADD brand TEXT DEFAULT NULL');
$this->addSql('COMMENT ON COLUMN customers.brand IS \'Brand\'');
}
/**
* @param Schema $schema
*
* @throws \Doctrine\DBAL\DBALException
*/
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE recipes DROP brand');
$this->addSql('ALTER TABLE customers DROP brand');
}
}