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