<?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 Version20240925133253 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->addSql("CREATE TABLE `tc_schedule_workorders_activity_log` (
`id` int NOT NULL AUTO_INCREMENT,
`company_id` int NOT NULL,
`user_id` int NOT NULL,
`action` varchar(255) NOT NULL,
`from_data` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci,
`to_data` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci,
`done_at` datetime NOT NULL,
`done_by` int NOT NULL,
PRIMARY KEY (`id`),
KEY `company_id` (`company_id`),
KEY `user_id` (`user_id`),
KEY `done_by` (`done_by`),
CONSTRAINT `tc_schedule_workorders_activity_log_ibfk_1` FOREIGN KEY (`company_id`) REFERENCES `company` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `tc_schedule_workorders_activity_log_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `tc_schedule_workorders_activity_log_ibfk_3` FOREIGN KEY (`done_by`) REFERENCES `user` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
)"
);
}
public function down(Schema $schema): void
{
$this->addSql("DROP TABLE IF EXISTS `tc_schedule_workorders_activity_log`");
}
}