migrations/Version20240909141123.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20240909141123 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         $this->addSql("CREATE TABLE `dp_workorder_import` (
  18.         `id` int NOT NULL AUTO_INCREMENT,
  19.         `import_id` int NOT NULL,
  20.         `workorder_id` int NOT NULL,
  21.         `reason` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  22.         `status` enum('success','failed','pending') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT 'pending',
  23.         `created_by` int NOT NULL,
  24.         `created_at` datetime NOT NULL,
  25.         PRIMARY KEY (`id`),
  26.         KEY `workorder_id` (`workorder_id`),
  27.         KEY `created_by` (`created_by`),
  28.         KEY `import_id` (`import_id`),
  29.         CONSTRAINT `dp_workorder_import_ibfk_1` FOREIGN KEY (`workorder_id`) REFERENCES `dp_workorder` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT,
  30.         CONSTRAINT `dp_workorder_import_ibfk_2` FOREIGN KEY (`created_by`) REFERENCES `user` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  31.         CONSTRAINT `dp_workorder_import_ibfk_3` FOREIGN KEY (`import_id`) REFERENCES `tc_imports` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
  32.         ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4");
  33.     }
  34.     public function down(Schema $schema): void
  35.     {
  36.         $this->addSql("DROP TABLE IF EXISTS `dp_workorder_import`");
  37.     }
  38. }