. */ use Phinx\Migration\AbstractMigration; /** * Migrations for schedule criteria * @phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace */ class UpdateCustomMetricPrefixMigration extends AbstractMigration { public function change(): void { // Only update metrics where type is 'custom' and the metric does not already start with 'custom_' $this->execute(" UPDATE `schedule_criteria` SET `metric` = CONCAT('custom_', `metric`) WHERE `type` = 'custom' AND `metric` NOT LIKE 'custom_%' "); } }