migrations/Version20230601140350.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 Version20230601140350 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(
  19.             '
  20.                 ALTER TABLE oim_case_tasks
  21.                     CHANGE description
  22.                         description TEXT NOT NULL COMMENT \'description of this task\'
  23.             '
  24.         );
  25.         $this->addSql(
  26.             '
  27.                 ALTER TABLE oim_conversations
  28.                     CHANGE conversation_notes
  29.                         conversation_notes TEXT DEFAULT NULL COMMENT \'Notes of this conversation\'
  30.             '
  31.         );
  32.         $this->addSql(
  33.             '
  34.                 ALTER TABLE oim_measures
  35.                     CHANGE description
  36.                         description TEXT DEFAULT NULL COMMENT \'description of this measure\',
  37.                     CHANGE date_from
  38.                         date_from DATETIME DEFAULT NULL COMMENT \'start date of measure\',
  39.                     CHANGE date_to
  40.                         date_to DATETIME DEFAULT NULL COMMENT \'end date of measure\',
  41.                     CHANGE finish_comment
  42.                         finish_comment TEXT DEFAULT NULL COMMENT \'comment after finished measure\'
  43.             '
  44.         );
  45.     }
  46.     public function down(Schema $schema): void
  47.     {
  48.         // this down() migration is auto-generated, please modify it to your needs
  49.         $this->addSql('ALTER TABLE oim_case_tasks CHANGE description description MEDIUMTEXT NOT NULL COMMENT \'description of this task\'');
  50.         $this->addSql('ALTER TABLE oim_conversations CHANGE conversation_notes conversation_notes MEDIUMTEXT DEFAULT NULL COMMENT \'Notes of this conversation\'');
  51.         $this->addSql('UPDATE oim_measures SET date_from = \'1000-01-01 00:00:00\'  WHERE date_from IS NULL');
  52.         $this->addSql('UPDATE oim_measures SET date_to = \'1000-01-01 00:00:00\'  WHERE date_to IS NULL');
  53.         $this->addSql('ALTER TABLE oim_measures CHANGE description description MEDIUMTEXT DEFAULT NULL COMMENT \'description of this measure\', CHANGE date_from date_from DATETIME NOT NULL COMMENT \'start date of measure\', CHANGE date_to date_to DATETIME NOT NULL COMMENT \'end date of measure\', CHANGE finish_comment finish_comment MEDIUMTEXT DEFAULT NULL COMMENT \'comment after finished measure\'');
  54.     }
  55. }