migrations/Version20260503120000.php line 1

Open in your IDE?
  1. <?php
  2. namespace DoctrineMigrations;
  3. use Doctrine\DBAL\Schema\Schema;
  4. use Doctrine\Migrations\AbstractMigration;
  5. final class Version20260503120000 extends AbstractMigration
  6. {
  7.     public function getDescription(): string
  8.     {
  9.         return 'Add automatic strength point toggle for temperature charts.';
  10.     }
  11.     public function up(Schema $schema): void
  12.     {
  13.         $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on postgresql.');
  14.         $this->addSql("ALTER TABLE measurement_settings ADD is_automatic_strength_points_enabled BOOLEAN DEFAULT FALSE NOT NULL");
  15.         $this->addSql("COMMENT ON COLUMN measurement_settings.is_automatic_strength_points_enabled IS 'Show automatic recipe strength points on temperature chart.'");
  16.     }
  17.     public function down(Schema $schema): void
  18.     {
  19.         $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on postgresql.');
  20.         $this->addSql('ALTER TABLE measurement_settings DROP is_automatic_strength_points_enabled');
  21.     }
  22. }