ogcore/migrations/Version20240820063513.php

42 lines
1.6 KiB
PHP

<?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 Version20240820063513 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 client ADD og_live_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE client ADD CONSTRAINT FK_C7440455F7E54CF3 FOREIGN KEY (og_live_id) REFERENCES og_live (id)');
$this->addSql('CREATE INDEX IDX_C7440455F7E54CF3 ON client (og_live_id)');
$this->addSql('ALTER TABLE network_settings ADD og_live_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE network_settings ADD CONSTRAINT FK_48869B54F7E54CF3 FOREIGN KEY (og_live_id) REFERENCES og_live (id)');
$this->addSql('CREATE INDEX IDX_48869B54F7E54CF3 ON network_settings (og_live_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE network_settings DROP FOREIGN KEY FK_48869B54F7E54CF3');
$this->addSql('DROP INDEX IDX_48869B54F7E54CF3 ON network_settings');
$this->addSql('ALTER TABLE network_settings DROP og_live_id');
$this->addSql('ALTER TABLE client DROP FOREIGN KEY FK_C7440455F7E54CF3');
$this->addSql('DROP INDEX IDX_C7440455F7E54CF3 ON client');
$this->addSql('ALTER TABLE client DROP og_live_id');
}
}