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