<?php
declare(strict_types=1);
namespace CoreMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20230313205129 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('CREATE TABLE activity (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', created_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', updated_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', deleted_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', entity_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', entity_name VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_AC74095AB03A8386 (created_by_id), INDEX IDX_AC74095A896DBBDE (updated_by_id), INDEX IDX_AC74095AC76F1F52 (deleted_by_id), INDEX entity_id (entity_id), INDEX entity_name (entity_name), INDEX deleted_at (deleted_at), INDEX created_at (created_at), INDEX updated_at (updated_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE activity_like (activity_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', user_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', INDEX IDX_AFA79B2181C06096 (activity_id), INDEX IDX_AFA79B21A76ED395 (user_id), PRIMARY KEY(activity_id, user_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE mail_message (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', created_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', updated_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', entity_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', entity_name VARCHAR(255) DEFAULT NULL, recipient VARCHAR(255) DEFAULT NULL, cc VARCHAR(255) DEFAULT NULL, bcc VARCHAR(255) DEFAULT NULL, subject VARCHAR(255) DEFAULT NULL, content LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_6C00B110B03A8386 (created_by_id), INDEX IDX_6C00B110896DBBDE (updated_by_id), INDEX entity_id (entity_id), INDEX entity_name (entity_name), INDEX recipient (recipient), INDEX cc (cc), INDEX bcc (bcc), INDEX subject (subject), INDEX created_at (created_at), INDEX updated_at (updated_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$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('ALTER TABLE activity_like ADD CONSTRAINT FK_AFA79B2181C06096 FOREIGN KEY (activity_id) REFERENCES activity (id)');
$this->addSql('ALTER TABLE activity_like ADD CONSTRAINT FK_AFA79B21A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE mail_message ADD CONSTRAINT FK_6C00B110B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE mail_message ADD CONSTRAINT FK_6C00B110896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (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('ALTER TABLE activity_like DROP FOREIGN KEY FK_AFA79B2181C06096');
$this->addSql('ALTER TABLE activity_like DROP FOREIGN KEY FK_AFA79B21A76ED395');
$this->addSql('ALTER TABLE mail_message DROP FOREIGN KEY FK_6C00B110B03A8386');
$this->addSql('ALTER TABLE mail_message DROP FOREIGN KEY FK_6C00B110896DBBDE');
$this->addSql('DROP TABLE activity');
$this->addSql('DROP TABLE activity_like');
$this->addSql('DROP TABLE mail_message');
}
}