<?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 Version20220427071919 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 projects ADD created_by_id INT DEFAULT NULL, ADD updated_by_id INT DEFAULT NULL, ADD created_at DATETIME DEFAULT NULL, ADD updated_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE projects ADD CONSTRAINT FK_5C93B3A4B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE projects ADD CONSTRAINT FK_5C93B3A4896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id) ON DELETE SET NULL');
$this->addSql('CREATE INDEX IDX_5C93B3A4B03A8386 ON projects (created_by_id)');
$this->addSql('CREATE INDEX IDX_5C93B3A4896DBBDE ON projects (updated_by_id)');
$this->addSql('ALTER TABLE section_title ADD created_by_id INT DEFAULT NULL, ADD updated_by_id INT DEFAULT NULL, ADD created_at DATETIME DEFAULT NULL, ADD updated_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE section_title ADD CONSTRAINT FK_BC611F0FB03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE section_title ADD CONSTRAINT FK_BC611F0F896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id) ON DELETE SET NULL');
$this->addSql('CREATE INDEX IDX_BC611F0FB03A8386 ON section_title (created_by_id)');
$this->addSql('CREATE INDEX IDX_BC611F0F896DBBDE ON section_title (updated_by_id)');
$this->addSql('ALTER TABLE tags ADD created_by_id INT DEFAULT NULL, ADD updated_by_id INT DEFAULT NULL, ADD created_at DATETIME DEFAULT NULL, ADD updated_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE tags ADD CONSTRAINT FK_6FBC9426B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE tags ADD CONSTRAINT FK_6FBC9426896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id) ON DELETE SET NULL');
$this->addSql('CREATE INDEX IDX_6FBC9426B03A8386 ON tags (created_by_id)');
$this->addSql('CREATE INDEX IDX_6FBC9426896DBBDE ON tags (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 projects DROP FOREIGN KEY FK_5C93B3A4B03A8386');
$this->addSql('ALTER TABLE projects DROP FOREIGN KEY FK_5C93B3A4896DBBDE');
$this->addSql('DROP INDEX IDX_5C93B3A4B03A8386 ON projects');
$this->addSql('DROP INDEX IDX_5C93B3A4896DBBDE ON projects');
$this->addSql('ALTER TABLE projects DROP created_by_id, DROP updated_by_id, DROP created_at, DROP updated_at');
$this->addSql('ALTER TABLE section_title DROP FOREIGN KEY FK_BC611F0FB03A8386');
$this->addSql('ALTER TABLE section_title DROP FOREIGN KEY FK_BC611F0F896DBBDE');
$this->addSql('DROP INDEX IDX_BC611F0FB03A8386 ON section_title');
$this->addSql('DROP INDEX IDX_BC611F0F896DBBDE ON section_title');
$this->addSql('ALTER TABLE section_title DROP created_by_id, DROP updated_by_id, DROP created_at, DROP updated_at');
$this->addSql('ALTER TABLE tags DROP FOREIGN KEY FK_6FBC9426B03A8386');
$this->addSql('ALTER TABLE tags DROP FOREIGN KEY FK_6FBC9426896DBBDE');
$this->addSql('DROP INDEX IDX_6FBC9426B03A8386 ON tags');
$this->addSql('DROP INDEX IDX_6FBC9426896DBBDE ON tags');
$this->addSql('ALTER TABLE tags DROP created_by_id, DROP updated_by_id, DROP created_at, DROP updated_at');
}
}