<?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 Version20191119062732 extends AbstractMigration
{
public function getDescription(): string
{
return 'drop field developer_id in table hub_user';
}
/**
* @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 hub_user DROP CONSTRAINT fk_8bd464f564dd9267');
$this->addSql('DROP INDEX uniq_8bd464f564dd9267');
$this->addSql('ALTER TABLE hub_user DROP developer_id');
}
/**
* @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('ALTER TABLE hub_user ADD developer_id UUID DEFAULT NULL');
$this->addSql('COMMENT ON COLUMN hub_user.developer_id IS \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE hub_user ADD CONSTRAINT fk_8bd464f564dd9267 FOREIGN KEY (developer_id) REFERENCES developer (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE UNIQUE INDEX uniq_8bd464f564dd9267 ON hub_user (developer_id)');
}
}