migrations/Version20220408102534.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 Version20220408102534 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return 'Correction type of the norm_full_day, norm_short_day fields of the work_position table, norm_time field of the plan_day';
  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 plan_day ALTER norm_time TYPE DOUBLE PRECISION');
  19.         $this->addSql('ALTER TABLE plan_day ALTER norm_time DROP DEFAULT');
  20.         $this->addSql('ALTER TABLE work_position ALTER norm_full_day TYPE DOUBLE PRECISION');
  21.         $this->addSql('ALTER TABLE work_position ALTER norm_full_day DROP DEFAULT');
  22.         $this->addSql('ALTER TABLE work_position ALTER norm_short_day TYPE DOUBLE PRECISION');
  23.         $this->addSql('ALTER TABLE work_position ALTER norm_short_day DROP DEFAULT');
  24.     }
  25.     public function down(Schema $schema): void
  26.     {
  27.         // this down() migration is auto-generated, please modify it to your needs
  28.         $this->addSql('ALTER TABLE work_position ALTER norm_full_day TYPE INT');
  29.         $this->addSql('ALTER TABLE work_position ALTER norm_full_day DROP DEFAULT');
  30.         $this->addSql('ALTER TABLE work_position ALTER norm_short_day TYPE INT');
  31.         $this->addSql('ALTER TABLE work_position ALTER norm_short_day DROP DEFAULT');
  32.         $this->addSql('ALTER TABLE plan_day ALTER norm_time TYPE SMALLINT');
  33.         $this->addSql('ALTER TABLE plan_day ALTER norm_time DROP DEFAULT');
  34.     }
  35. }