<?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 Version20230609151924 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 shop ADD source_id INT NOT NULL, DROP communication_mode');
$this->addSql('UPDATE shop SET source_id = 1');
$this->addSql('ALTER TABLE shop ADD CONSTRAINT FK_AC6A4CA2953C1C61 FOREIGN KEY (source_id) REFERENCES source (id)');
$this->addSql('CREATE INDEX IDX_AC6A4CA2953C1C61 ON shop (source_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE shop DROP FOREIGN KEY FK_AC6A4CA2953C1C61');
$this->addSql('DROP INDEX IDX_AC6A4CA2953C1C61 ON shop');
$this->addSql('ALTER TABLE shop ADD communication_mode VARCHAR(50) NOT NULL, DROP source_id');
}
}