<?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 Version20240909141123 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->addSql("CREATE TABLE `dp_workorder_import` (
`id` int NOT NULL AUTO_INCREMENT,
`import_id` int NOT NULL,
`workorder_id` int NOT NULL,
`reason` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
`status` enum('success','failed','pending') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT 'pending',
`created_by` int NOT NULL,
`created_at` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `workorder_id` (`workorder_id`),
KEY `created_by` (`created_by`),
KEY `import_id` (`import_id`),
CONSTRAINT `dp_workorder_import_ibfk_1` FOREIGN KEY (`workorder_id`) REFERENCES `dp_workorder` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT,
CONSTRAINT `dp_workorder_import_ibfk_2` FOREIGN KEY (`created_by`) REFERENCES `user` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `dp_workorder_import_ibfk_3` FOREIGN KEY (`import_id`) REFERENCES `tc_imports` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4");
}
public function down(Schema $schema): void
{
$this->addSql("DROP TABLE IF EXISTS `dp_workorder_import`");
}
}