migrations/Version20241018094823.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 Version20241018094823 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_manage_holidays` (
  18.             `id` int NOT NULL AUTO_INCREMENT,
  19.             `title` varchar(255) NOT NULL,
  20.             `date` date NOT NULL,
  21.             `board` int DEFAULT NULL,
  22.             `is_allBoard` int NOT NULL DEFAULT '0',
  23.             `company_id` int NOT NULL,
  24.             `created_by` int NOT NULL,
  25.             `created_at` datetime NOT NULL,
  26.             `updated_by` int DEFAULT NULL,
  27.             `updated_at` datetime DEFAULT NULL,
  28.             `is_deleted` int NOT NULL DEFAULT '0',
  29.             `deleted_by` int DEFAULT NULL,
  30.             `deleted_at` datetime DEFAULT NULL,
  31.             PRIMARY KEY (`id`),
  32.             KEY `company_id` (`company_id`),
  33.             KEY `board_id` (`board`),
  34.             KEY `created_by` (`created_by`),
  35.             KEY `updated_by` (`updated_by`),
  36.             KEY `deleted_by` (`deleted_by`),
  37.             CONSTRAINT `dp_manage_holidays_ibfk_1` FOREIGN KEY (`board`) REFERENCES `dp_levels` (`level_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  38.             CONSTRAINT `dp_manage_holidays_ibfk_2` FOREIGN KEY (`company_id`) REFERENCES `company` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  39.             CONSTRAINT `dp_manage_holidays_ibfk_3` FOREIGN KEY (`created_by`) REFERENCES `user` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  40.             CONSTRAINT `dp_manage_holidays_ibfk_4` FOREIGN KEY (`updated_by`) REFERENCES `user` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  41.             CONSTRAINT `dp_manage_holidays_ibfk_5` FOREIGN KEY (`deleted_by`) REFERENCES `user` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
  42.           ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci");
  43.     }
  44.     public function down(Schema $schema): void
  45.     {
  46.         $this->addSql("DROP TABLE IF EXISTS `dp_manage_holidays`");
  47.     }
  48. }