<?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 Version20221021084318 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 shopping_cart ADD user_id INT DEFAULT NULL, ADD updated_by_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE shopping_cart ADD CONSTRAINT FK_72AAD4F6A76ED395 FOREIGN KEY (user_id) REFERENCES users (id)');
$this->addSql('ALTER TABLE shopping_cart ADD CONSTRAINT FK_72AAD4F6896DBBDE FOREIGN KEY (updated_by_id) REFERENCES users (id)');
$this->addSql('CREATE INDEX IDX_72AAD4F6A76ED395 ON shopping_cart (user_id)');
$this->addSql('CREATE INDEX IDX_72AAD4F6896DBBDE ON shopping_cart (updated_by_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE shopping_cart DROP FOREIGN KEY FK_72AAD4F6A76ED395');
$this->addSql('ALTER TABLE shopping_cart DROP FOREIGN KEY FK_72AAD4F6896DBBDE');
$this->addSql('DROP INDEX IDX_72AAD4F6A76ED395 ON shopping_cart');
$this->addSql('DROP INDEX IDX_72AAD4F6896DBBDE ON shopping_cart');
$this->addSql('ALTER TABLE shopping_cart DROP user_id, DROP updated_by_id');
}
}