<?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 Version20251114154500 extends AbstractMigration
{
public function getDescription(): string
{
return 'Create app_user_event table';
}
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE mybiz_user_event (
id INT AUTO_INCREMENT NOT NULL,
member_id INT NOT NULL,
title VARCHAR(255) NOT NULL,
description TEXT DEFAULT NULL,
datetime DATETIME NOT NULL,
created_at DATETIME NOT NULL,
INDEX IDX_USER_EVENT_MEMBER (member_id),
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE mybiz_user_event ADD CONSTRAINT FK_USER_EVENT_MEMBER FOREIGN KEY (member_id) REFERENCES app_member (id)');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE mybiz_user_event DROP FOREIGN KEY FK_USER_EVENT_MEMBER');
$this->addSql('DROP TABLE mybiz_user_event');
}
}