<?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 Version20211127142335 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 domain CHANGE is_enabled is_enabled TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE git_depot DROP FOREIGN KEY FK_75E671E8A76ED395');
$this->addSql('DROP INDEX IDX_75E671E8A76ED395 ON git_depot');
$this->addSql('ALTER TABLE git_depot DROP user_id');
$this->addSql('ALTER TABLE organisation CHANGE is_added is_added TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE subscription ADD organisation_id INT NOT NULL');
$this->addSql('ALTER TABLE subscription ADD CONSTRAINT FK_A3C664D39E6B1585 FOREIGN KEY (organisation_id) REFERENCES organisation (id)');
$this->addSql('CREATE INDEX IDX_A3C664D39E6B1585 ON subscription (organisation_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE domain CHANGE is_enabled is_enabled TINYINT(1) DEFAULT \'0\' NOT NULL');
$this->addSql('ALTER TABLE git_depot ADD user_id INT NOT NULL');
$this->addSql('ALTER TABLE git_depot ADD CONSTRAINT FK_75E671E8A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('CREATE INDEX IDX_75E671E8A76ED395 ON git_depot (user_id)');
$this->addSql('ALTER TABLE organisation CHANGE is_added is_added TINYINT(1) DEFAULT \'0\' NOT NULL');
$this->addSql('ALTER TABLE subscription DROP FOREIGN KEY FK_A3C664D39E6B1585');
$this->addSql('DROP INDEX IDX_A3C664D39E6B1585 ON subscription');
$this->addSql('ALTER TABLE subscription DROP organisation_id');
}
}