<?php
use Phinx\Migration\AbstractMigration;
class ReplaceCharsInRating extends AbstractMigration
{
/**
* Migrate Up.
*/
public function up(): void
{
$this->execute("UPDATE rating SET text = replace(`text`, '&', '&')");
$this->execute("UPDATE rating SET text = replace(`text`, '"', '\"')");
$this->execute("UPDATE rating SET text = replace(`text`, ''', \"'\")");
$this->execute("UPDATE rating SET text = replace(`text`, ''', \"'\")");
$this->execute("UPDATE rating SET text = replace(`text`, '$', '$')");
$this->execute("UPDATE rating SET text = replace(`text`, '\', '\\\')");
$this->execute("UPDATE rating SET text = replace(`text`, '|', '|')");
$this->execute("UPDATE rating SET text = replace(`text`, '^', '^')");
$this->execute("UPDATE rating SET text = replace(`text`, '`', '`')");
$this->execute("UPDATE rating SET text = replace(`text`, '%', '%')");
$this->execute("UPDATE rating SET text = replace(`text`, ':', ':')");
$this->execute("UPDATE rating SET text = replace(`text`, '@', '@')");
$this->execute("UPDATE rating SET text = replace(`text`, '<', '<')");
$this->execute("UPDATE rating SET text = replace(`text`, '>', '>')");
}
/**
* Migrate Down.
*/
public function down(): void
{
$this->execute("UPDATE rating SET text = replace(`text`, '&', '&')");
$this->execute("UPDATE rating SET text = replace(`text`, '\"', '"')");
$this->execute("UPDATE rating SET text = replace(`text`, \"'\", ''')");
$this->execute("UPDATE rating SET text = replace(`text`, '<', '<')");
$this->execute("UPDATE rating SET text = replace(`text`, '>', '>')");
}
}