<?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 Version20230804104239 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 recents_activity (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, member_entity_id INT DEFAULT NULL, event_entity_id INT DEFAULT NULL, boisson_entity_id INT DEFAULT NULL, category_boissons_entity_id INT DEFAULT NULL, notification_entity_id INT DEFAULT NULL, created_at DATETIME NOT NULL, name_of_activity VARCHAR(255) NOT NULL, description_of_activity VARCHAR(255) NOT NULL, INDEX IDX_D0FF1D90B03A8386 (created_by_id), INDEX IDX_D0FF1D90C10DAB98 (member_entity_id), INDEX IDX_D0FF1D907B04360 (event_entity_id), INDEX IDX_D0FF1D90BB6F2E0 (boisson_entity_id), INDEX IDX_D0FF1D9018374EB4 (category_boissons_entity_id), INDEX IDX_D0FF1D9027CC3A02 (notification_entity_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE recents_activity ADD CONSTRAINT FK_D0FF1D90B03A8386 FOREIGN KEY (created_by_id) REFERENCES `user` (id)');
$this->addSql('ALTER TABLE recents_activity ADD CONSTRAINT FK_D0FF1D90C10DAB98 FOREIGN KEY (member_entity_id) REFERENCES `user` (id)');
$this->addSql('ALTER TABLE recents_activity ADD CONSTRAINT FK_D0FF1D907B04360 FOREIGN KEY (event_entity_id) REFERENCES events (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE recents_activity ADD CONSTRAINT FK_D0FF1D90BB6F2E0 FOREIGN KEY (boisson_entity_id) REFERENCES boissons (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE recents_activity ADD CONSTRAINT FK_D0FF1D9018374EB4 FOREIGN KEY (category_boissons_entity_id) REFERENCES category_boissons (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE recents_activity ADD CONSTRAINT FK_D0FF1D9027CC3A02 FOREIGN KEY (notification_entity_id) REFERENCES notifications_send (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE recents_activity DROP FOREIGN KEY FK_D0FF1D90B03A8386');
$this->addSql('ALTER TABLE recents_activity DROP FOREIGN KEY FK_D0FF1D90C10DAB98');
$this->addSql('ALTER TABLE recents_activity DROP FOREIGN KEY FK_D0FF1D907B04360');
$this->addSql('ALTER TABLE recents_activity DROP FOREIGN KEY FK_D0FF1D90BB6F2E0');
$this->addSql('ALTER TABLE recents_activity DROP FOREIGN KEY FK_D0FF1D9018374EB4');
$this->addSql('ALTER TABLE recents_activity DROP FOREIGN KEY FK_D0FF1D9027CC3A02');
$this->addSql('DROP TABLE recents_activity');
}
}