<?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 Version20240920045811 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->addSql("CREATE TABLE `tc_customer_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,
`to_data` mediumtext,
`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_customer_activity_log_ibfk_1` FOREIGN KEY (`company_id`) REFERENCES `company` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `tc_customer_activity_log_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `tc_customer_activity_log_ibfk_3` FOREIGN KEY (`done_by`) REFERENCES `user` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT)"
);
$this->addSql("CREATE TABLE `tc_excel_import_log` (
`id` int NOT NULL AUTO_INCREMENT,
`company_id` int NOT NULL,
`user_id` int NOT NULL,
`action` varchar(255) NOT NULL,
`filename` varchar(255) NOT NULL,
`to_data` mediumtext NOT NULL,
`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_excel_import_log_ibfk_1` FOREIGN KEY (`company_id`) REFERENCES `company` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `tc_excel_import_log_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `tc_excel_import_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_customer_activity_log`");
$this->addSql("DROP TABLE IF EXISTS `tc_excel_import_log`");
}
}