migrations/Version20230509072802.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 Version20230509072802 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_measures
  21.                     ADD measure_id INT DEFAULT NULL COMMENT \'Internal ID\',
  22.                     ADD status INT NOT NULL COMMENT \'status of current measure\'
  23.             '
  24.         );
  25.         $this->addSql(
  26.             '
  27.                 ALTER TABLE oim_measures ADD CONSTRAINT FK_B6D05FF05DA37D00 FOREIGN KEY
  28.                     (measure_id) REFERENCES oim_measure (id);
  29.             '
  30.         );
  31.         $this->addSql('CREATE INDEX IDX_B6D05FF05DA37D00 ON oim_measures (measure_id)');
  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 oim_measures DROP FOREIGN KEY FK_B6D05FF05DA37D00');
  37.         $this->addSql('DROP INDEX IDX_B6D05FF05DA37D00 ON oim_measures');
  38.     }
  39. }