<?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 Version20250819093553 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 sob_event_document (
id INT AUTO_INCREMENT NOT NULL COMMENT \'Internal ID\',
parent INT NOT NULL COMMENT \'Internal ID\',
created INT NOT NULL COMMENT \'Entity creation date as UNIX timestamp\',
active SMALLINT DEFAULT 1 NOT NULL COMMENT \'Indicator if entity is active\',
last_active_date DATE DEFAULT NULL COMMENT \'Last active date\',
uuid VARCHAR(36) NOT NULL COMMENT \'UUID for file\',
name VARCHAR(225) NOT NULL COMMENT \'Name for file\',
mime_type VARCHAR(32) NOT NULL COMMENT \'MIME type for file\',
hash VARCHAR(32) NOT NULL COMMENT \'Hash for file\',
extension VARCHAR(3) NOT NULL COMMENT \'Extension for file\',
property_name VARCHAR(32) NOT NULL COMMENT \'Property name for file\',
UNIQUE INDEX UNIQ_DA5C7796D17F50A6 (uuid),
INDEX IDX_DA5C77963D8E604F (parent),
PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB
'
);
$this->addSql(
'
ALTER TABLE sob_event_document ADD CONSTRAINT FK_DA5C77963D8E604F FOREIGN KEY
(parent) REFERENCES sob_event (id) ON DELETE CASCADE
'
);
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE sob_event_document DROP FOREIGN KEY FK_DA5C77963D8E604F');
$this->addSql('DROP TABLE sob_event_document');
}
}