<?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 Version20250520102851 extends AbstractMigration
{
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE sob_task DROP FOREIGN KEY FK_B6468764C54C8C93');
$this->addSql('ALTER TABLE sob_task DROP FOREIGN KEY FK_B6468764AF060DA6');
$this->addSql('ALTER TABLE sob_task DROP FOREIGN KEY FK_B64687647D182D95');
$this->addSql('DROP TABLE sob_task');
}
public function getDescription(): string
{
return '';
}
// this down() migration is auto-generated, please modify it to your needs
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql(
'
CREATE TABLE sob_task (
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_user_id 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\',
due_date DATE DEFAULT NULL COMMENT \'Due date\',
notes TINYTEXT DEFAULT NULL COMMENT \'Notes\',
INDEX IDX_B6468764C54C8C93 (type_id),
INDEX IDX_B6468764AF060DA6 (case_entity_id),
INDEX IDX_B64687647D182D95 (created_by_user_id),
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB
'
);
$this->addSql(
'
ALTER TABLE sob_task ADD CONSTRAINT FK_B6468764C54C8C93
FOREIGN KEY (type_id) REFERENCES sob_task_type (id)
'
);
$this->addSql(
'
ALTER TABLE sob_task ADD CONSTRAINT FK_B6468764AF060DA6
FOREIGN KEY (case_entity_id) REFERENCES sob_case (id) ON DELETE CASCADE
'
);
$this->addSql(
'
ALTER TABLE sob_task ADD CONSTRAINT FK_B64687647D182D95
FOREIGN KEY (created_by_user_id) REFERENCES user (id)
'
);
}
}