<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20241031114726 extends AbstractMigration
{
public function getDescription(): string
{
return 'Protection for bus_stop table';
}
public function up(Schema $schema): void
{
// add unique key for map_plus_code and route_id in bus_stop table
// $this->addSql('ALTER TABLE bus_stop ADD CONSTRAINT bus_stop_map_plus_code_route_id UNIQUE (map_plus_code, route_id)');
//add unique key for name and route_id in bus_stop table
// $this->addSql('ALTER TABLE bus_stop ADD CONSTRAINT bus_stop_name_route_id UNIQUE (name, route_id)');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE bus_stop DROP CONSTRAINT bus_stop_map_plus_code_route_id');
$this->addSql('ALTER TABLE bus_stop DROP CONSTRAINT bus_stop_name_route_id');
}
}