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