<?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 Version20220927160913 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 api_key_map DROP FOREIGN KEY FK_AA9AC30C54963938');
$this->addSql('DROP INDEX FK_api_key_map_apis ON api_key_map');
$this->addSql('ALTER TABLE api_key_map CHANGE api_id endpoind_version_model_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE api_key_map ADD CONSTRAINT FK_AA9AC30C742222F4 FOREIGN KEY (endpoind_version_model_id) REFERENCES endpoind_version_models (id)');
$this->addSql('CREATE INDEX IDX_AA9AC30C742222F4 ON api_key_map (endpoind_version_model_id)');
$this->addSql('ALTER TABLE api_key_map RENAME INDEX fk_api_key_map_api_keys TO IDX_AA9AC30C8BE312B3');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE api_key_map DROP FOREIGN KEY FK_AA9AC30C742222F4');
$this->addSql('DROP INDEX IDX_AA9AC30C742222F4 ON api_key_map');
$this->addSql('ALTER TABLE api_key_map CHANGE endpoind_version_model_id api_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE api_key_map ADD CONSTRAINT FK_AA9AC30C54963938 FOREIGN KEY (api_id) REFERENCES apis (id)');
$this->addSql('CREATE INDEX FK_api_key_map_apis ON api_key_map (api_id)');
$this->addSql('ALTER TABLE api_key_map RENAME INDEX idx_aa9ac30c8be312b3 TO FK_api_key_map_api_keys');
}
}