migrations/Version20251103182829.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 Version20251103182829 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->addSql("ALTER TABLE `pck_packagetypes` 
  19. DROP FOREIGN KEY `pck_packagetypes_ibfk_1`;
  20. ALTER TABLE `pck_packagetypes` 
  21. CHANGE COLUMN `billing_category_id` `billing_category_id` INT NOT NULL ;
  22. ALTER TABLE `pck_packagetypes` 
  23. ADD CONSTRAINT `pck_packagetypes_ibfk_1`
  24.   FOREIGN KEY (`billing_category_id`)
  25.   REFERENCES `billing_categories` (`id`);");
  26.         $this->addSql("ALTER TABLE `billing_category_rates` 
  27.             CHANGE COLUMN `date_time` `date_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ;");
  28.     }
  29.     public function down(Schema $schema): void
  30.     {
  31.         // this down() migration is auto-generated, please modify it to your needs
  32.         $this->addSql("ALTER TABLE `pck_packagetypes` 
  33.                             DROP FOREIGN KEY `pck_packagetypes_ibfk_1`;
  34.                             ALTER TABLE `pck_packagetypes` 
  35.                             CHANGE COLUMN `billing_category_id` `billing_category_id` INT NULL ;
  36.                             ALTER TABLE `pck_packagetypes` 
  37.                             ADD CONSTRAINT `pck_packagetypes_ibfk_1`
  38.                               FOREIGN KEY (`billing_category_id`)
  39.                               REFERENCES `billing_categories` (`id`);");
  40.         $this->addSql("ALTER TABLE `billing_category_rates` 
  41.             CHANGE COLUMN `date_time` `date_time` DATETIME NOT NULL ");
  42.     }
  43. }