<?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 Version20210720084156 extends AbstractMigration
{
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 parkingslot ADD actual_car_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE parkingslot ADD CONSTRAINT FK_72DCE8D5B6837A7D FOREIGN KEY (actual_car_id) REFERENCES car (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_72DCE8D5B6837A7D ON parkingslot (actual_car_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE parkingslot DROP FOREIGN KEY FK_72DCE8D5B6837A7D');
$this->addSql('DROP INDEX UNIQ_72DCE8D5B6837A7D ON parkingslot');
$this->addSql('ALTER TABLE parkingslot DROP actual_car_id');
}
}