<?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 Version20220530203241 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 activity ADD created_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD updated_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD deleted_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD created_at DATE NOT NULL COMMENT \'(DC2Type:date_immutable)\', ADD updated_at DATE NOT NULL COMMENT \'(DC2Type:date_immutable)\'');
$this->addSql('ALTER TABLE activity ADD CONSTRAINT FK_AC74095AB03A8386 FOREIGN KEY (created_by_id) REFERENCES `user` (id)');
$this->addSql('ALTER TABLE activity ADD CONSTRAINT FK_AC74095A896DBBDE FOREIGN KEY (updated_by_id) REFERENCES `user` (id)');
$this->addSql('ALTER TABLE activity ADD CONSTRAINT FK_AC74095AC76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES `user` (id)');
$this->addSql('CREATE INDEX IDX_AC74095AB03A8386 ON activity (created_by_id)');
$this->addSql('CREATE INDEX IDX_AC74095A896DBBDE ON activity (updated_by_id)');
$this->addSql('CREATE INDEX IDX_AC74095AC76F1F52 ON activity (deleted_by_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE activity DROP FOREIGN KEY FK_AC74095AB03A8386');
$this->addSql('ALTER TABLE activity DROP FOREIGN KEY FK_AC74095A896DBBDE');
$this->addSql('ALTER TABLE activity DROP FOREIGN KEY FK_AC74095AC76F1F52');
$this->addSql('DROP INDEX IDX_AC74095AB03A8386 ON activity');
$this->addSql('DROP INDEX IDX_AC74095A896DBBDE ON activity');
$this->addSql('DROP INDEX IDX_AC74095AC76F1F52 ON activity');
$this->addSql('ALTER TABLE activity DROP created_by_id, DROP updated_by_id, DROP deleted_by_id, DROP created_at, DROP updated_at');
}
}