<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20240604120000 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add persistent calendar_event table for admin calendar.';
}
public function up(Schema $schema): void
{
$this->addSql("CREATE TABLE calendar_event (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL, start_at DATETIME NOT NULL, end_at DATETIME DEFAULT NULL, all_day TINYINT(1) NOT NULL, color VARCHAR(32) NOT NULL, class_names JSON DEFAULT NULL, recurrence_source VARCHAR(255) DEFAULT NULL, source VARCHAR(64) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, INDEX IDX_CALENDAR_EVENT_START_AT (start_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB");
}
public function down(Schema $schema): void
{
$this->addSql('DROP TABLE calendar_event');
}
}