migrations/Version20250318171334.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 Version20250318171334 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return 'Set null created dates in AbstractReservation entities to 2022-03-29 00:00:00';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // Update null created dates in Reservation table
  18.         $this->addSql('UPDATE reservation SET created = "2022-03-29 00:00:00" WHERE created IS NULL');
  19.         
  20.         // Update null created dates in Token table
  21.         $this->addSql('UPDATE token SET created = "2022-03-29 00:00:00" WHERE created IS NULL');
  22.     }
  23.     public function down(Schema $schema): void
  24.     {
  25.         // Cannot safely revert this migration as we don't know which records originally had NULL values
  26.         $this->write('This migration cannot be reverted');
  27.     }
  28. }