migrations/Version20240314183709.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 Version20240314183709 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // "glucose" will be removed in a later migration
  18.         $this->addSql('ALTER TABLE cardiometabolic_profiles
  19.             ADD glucose DOUBLE PRECISION NOT NULL,
  20.             ADD creatinine DOUBLE PRECISION NOT NULL,
  21.             ADD urea DOUBLE PRECISION NOT NULL,
  22.             ADD e_gfr DOUBLE PRECISION NOT NULL'
  23.         );
  24.         // "glucose" will be renamed to "fasting_blood_sugar" in a later migration
  25.         $this->addSql(
  26.             'ALTER TABLE health_report_submissions
  27.             ADD total_cholesterol DOUBLE PRECISION DEFAULT NULL,
  28.             ADD hdl_cholesterol DOUBLE PRECISION DEFAULT NULL,
  29.             ADD glucose DOUBLE PRECISION DEFAULT NULL,
  30.             ADD hba1c DOUBLE PRECISION DEFAULT NULL,
  31.             ADD creatinine DOUBLE PRECISION DEFAULT NULL,
  32.             ADD urea DOUBLE PRECISION DEFAULT NULL'
  33.         );
  34. }
  35.     public function down(Schema $schema): void
  36.     {
  37.         // this down() migration is auto-generated, please modify it to your needs
  38.         $this->addSql(
  39.             'ALTER TABLE cardiometabolic_profiles DROP glucose, DROP creatinine, DROP urea, DROP e_gfr'
  40.         );
  41.         $this->addSql(
  42.             'ALTER TABLE health_report_submissions
  43.             DROP total_cholesterol,
  44.             DROP hdl_cholesterol,
  45.             DROP glucose,
  46.             DROP hba1c,
  47.             DROP creatinine,
  48.             DROP urea'
  49.         );
  50.     }
  51. }