migrations/Version20211125114100.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 Version20211125114100 extends AbstractMigration
  10. {
  11.     /**
  12.      * @return string
  13.      */
  14.     public function getDescription() : string
  15.     {
  16.         return '';
  17.     }
  18.     /**
  19.      * @param Schema $schema
  20.      *
  21.      * @throws \Doctrine\DBAL\DBALException
  22.      */
  23.     public function up(Schema $schema) : void
  24.     {
  25.         // this up() migration is auto-generated, please modify it to your needs
  26.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql''Migration can only be executed safely on \'postgresql\'.');
  27.         $this->addSql('ALTER TABLE customers ADD country TEXT DEFAULT NULL');
  28.         $this->addSql('COMMENT ON COLUMN customers.country IS \'Company country\'');
  29.     }
  30.     /**
  31.      * @param Schema $schema
  32.      *
  33.      * @throws \Doctrine\DBAL\DBALException
  34.      */
  35.     public function down(Schema $schema) : void
  36.     {
  37.         // this down() migration is auto-generated, please modify it to your needs
  38.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql''Migration can only be executed safely on \'postgresql\'.');
  39.         $this->addSql('CREATE SCHEMA public');
  40.         $this->addSql('ALTER TABLE customers DROP country');
  41.     }
  42. }