<?php
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20260424100000 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add temperature split view settings for measurements and channels.';
}
public function up(Schema $schema): void
{
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on postgresql.');
$this->addSql("ALTER TABLE measurement_settings ADD is_temperature_split_view BOOLEAN DEFAULT FALSE NOT NULL");
$this->addSql("COMMENT ON COLUMN measurement_settings.is_temperature_split_view IS 'Is temperature chart split into two diagrams'");
$this->addSql("ALTER TABLE channel_settings ADD diagram_group INT DEFAULT 1 NOT NULL");
$this->addSql("COMMENT ON COLUMN channel_settings.diagram_group IS 'Temperature diagram group.'");
}
public function down(Schema $schema): void
{
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on postgresql.');
$this->addSql('ALTER TABLE channel_settings DROP diagram_group');
$this->addSql('ALTER TABLE measurement_settings DROP is_temperature_split_view');
}
}