<?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 Version20250716084407 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 (
id INT AUTO_INCREMENT NOT NULL COMMENT \'Internal ID\',
type_id INT DEFAULT NULL COMMENT \'Internal ID\',
case_entity_id INT NOT NULL COMMENT \'Internal ID\',
created_by INT DEFAULT 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\',
event_date DATE DEFAULT NULL COMMENT \'Event date\',
notes TEXT DEFAULT NULL COMMENT \'Notes\',
updated_by INT DEFAULT NULL COMMENT \'Internal ID\',
updated INT DEFAULT NULL COMMENT \'Entity update date as UNIX timestamp\',
INDEX IDX_3A9143FDC54C8C93 (type_id),
INDEX IDX_3A9143FDAF060DA6 (case_entity_id),
INDEX IDX_3A9143FDDE12AB56 (created_by),
INDEX IDX_3A9143FD16FE72E1 (updated_by),
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB
'
);
$this->addSql(
'
ALTER TABLE sob_event ADD CONSTRAINT FK_3A9143FDC54C8C93
FOREIGN KEY (type_id) REFERENCES sob_event_type (id)
'
);
$this->addSql(
'
ALTER TABLE sob_event ADD CONSTRAINT FK_3A9143FDAF060DA6
FOREIGN KEY (case_entity_id) REFERENCES sob_case (id) ON DELETE CASCADE
'
);
$this->addSql(
'
ALTER TABLE sob_event ADD CONSTRAINT FK_3A9143FDDE12AB56
FOREIGN KEY (created_by) REFERENCES user (id)
'
);
$this->addSql(
'
ALTER TABLE sob_event ADD CONSTRAINT FK_3A9143FD16FE72E1
FOREIGN KEY (updated_by) 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 sob_event DROP FOREIGN KEY FK_3A9143FDC54C8C93');
$this->addSql('ALTER TABLE sob_event DROP FOREIGN KEY FK_3A9143FDAF060DA6');
$this->addSql('ALTER TABLE sob_event DROP FOREIGN KEY FK_3A9143FDDE12AB56');
$this->addSql('ALTER TABLE sob_event DROP FOREIGN KEY FK_3A9143FD16FE72E1');
$this->addSql('DROP TABLE sob_event');
}
}