migrations/Version20260205095551.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 Version20260205095551 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 channel_user_data_cursus_founder CHANGE amount_hours amount_time INT NOT NULL');
  19.         $this->addSql('ALTER TABLE channel_sessions CHANGE count_hours_in_center duration_in_center INT DEFAULT 0 NOT NULL, CHANGE count_hours_in_company duration_in_company INT DEFAULT 0 NOT NULL, CHANGE count_hours_visio duration_in_visio INT DEFAULT 0 NOT NULL, CHANGE count_hours_elearning duration_in_elearning INT DEFAULT 0 NOT NULL, CHANGE count_hours_exam duration_in_exam INT DEFAULT 0 NOT NULL');
  20.         $this->addSql('UPDATE channel_sessions SET duration_in_center = duration_in_center * 60');
  21.         $this->addSql('UPDATE channel_sessions SET duration_in_company = duration_in_company * 60');
  22.         $this->addSql('UPDATE channel_sessions SET duration_in_visio = duration_in_visio * 60');
  23.         $this->addSql('UPDATE channel_sessions SET duration_in_elearning = duration_in_elearning * 60');
  24.         $this->addSql('UPDATE channel_sessions SET duration_in_exam = duration_in_exam * 60');
  25.         $this->addSql('UPDATE channel_user_data_cursus SET exam_duration = exam_duration * 60');
  26.         $this->addSql('UPDATE channel_user_data_cursus SET physical_duration = physical_duration * 60');
  27.         $this->addSql('UPDATE channel_user_data_cursus SET distance_async_duration = distance_async_duration * 60');
  28.         $this->addSql('UPDATE channel_user_data_cursus SET distance_sync_duration = distance_sync_duration * 60');
  29.         $this->addSql('UPDATE channel_user_data_cursus SET internship_duration = internship_duration * 60');
  30.         $this->addSql('UPDATE channel_user_data_cursus_internship SET duration = duration * 60');
  31.         $this->addSql('UPDATE channel_user_data_cursus_founder SET amount_time = amount_time * 60');
  32.     }
  33.     public function down(Schema $schema): void
  34.     {
  35.         // this down() migration is auto-generated, please modify it to your needs
  36.         $this->addSql('ALTER TABLE channel_user_data_cursus_founder CHANGE amount_time amount_hours INT NOT NULL');
  37.         $this->addSql('ALTER TABLE channel_sessions ADD count_hours_in_center INT DEFAULT 0 NOT NULL, ADD count_hours_in_company INT DEFAULT 0 NOT NULL, ADD count_hours_visio INT DEFAULT 0 NOT NULL, ADD count_hours_elearning INT DEFAULT 0 NOT NULL, ADD count_hours_exam INT DEFAULT 0 NOT NULL, DROP duration_in_center, DROP duration_in_company, DROP duration_in_visio, DROP duration_in_elearning, DROP duration_in_exam');
  38.     }
  39. }