<?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 Version20230315222527 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 oauth_access_token DROP FOREIGN KEY FK_F7FA86A41AD5CDBF');
$this->addSql('DROP INDEX UNIQ_F7FA86A41AD5CDBF ON oauth_access_token');
$this->addSql('ALTER TABLE oauth_access_token DROP cart_id');
$this->addSql('ALTER TABLE oauth_client DROP FOREIGN KEY FK_AD73274D9DEA1320');
$this->addSql('ALTER TABLE oauth_client ADD CONSTRAINT FK_AD73274D9DEA1320 FOREIGN KEY (application_client_id) REFERENCES client (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE oauth_access_token ADD cart_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE oauth_access_token ADD CONSTRAINT FK_F7FA86A41AD5CDBF FOREIGN KEY (cart_id) REFERENCES cart (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_F7FA86A41AD5CDBF ON oauth_access_token (cart_id)');
$this->addSql('ALTER TABLE oauth_client DROP FOREIGN KEY FK_AD73274D9DEA1320');
$this->addSql('ALTER TABLE oauth_client ADD CONSTRAINT FK_AD73274D9DEA1320 FOREIGN KEY (application_client_id) REFERENCES client (id) ON DELETE CASCADE');
}
}