<?php
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20260525120000 extends AbstractMigration
{
public function getDescription(): string
{
return 'Make automatic MPa chart indicators off by default.';
}
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 ALTER is_automatic_strength_points_enabled SET DEFAULT FALSE');
$this->addSql('UPDATE measurement_settings SET is_automatic_strength_points_enabled = FALSE WHERE is_automatic_strength_points_enabled = TRUE');
}
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 measurement_settings ALTER is_automatic_strength_points_enabled SET DEFAULT TRUE');
}
}