Skip to content

Commit

Permalink
Add forgotten UPPER()
Browse files Browse the repository at this point in the history
  • Loading branch information
richard67 committed Jul 20, 2019
1 parent 585c817 commit 32711a0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions libraries/src/Schema/ChangeItem/MysqlChangeItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,30 +291,32 @@ private function fixQuote($string)
*/
private function fixUtf8mb4TypeChecks($type)
{
$uType = strtoupper(str_replace(';', '', $type));
$fixedType = str_replace(';', '', $type);

if ($this->db->hasUTF8mb4Support())
{
$uType = strtoupper($fixedType);

if ($uType === 'TINYTEXT')
{
$typeCheck = 'type IN (' . $this->db->quote('TINYTEXT') . ',' . $this->db->quote('TEXT') . ')';
$typeCheck = 'UPPER(type) IN (' . $this->db->quote('TINYTEXT') . ',' . $this->db->quote('TEXT') . ')';
}
elseif ($uType === 'TEXT')
{
$typeCheck = 'type IN (' . $this->db->quote('TEXT') . ',' . $this->db->quote('MEDIUMTEXT') . ')';
$typeCheck = 'UPPER(type) IN (' . $this->db->quote('TEXT') . ',' . $this->db->quote('MEDIUMTEXT') . ')';
}
elseif ($uType === 'MEDIUMTEXT')
{
$typeCheck = 'type IN (' . $this->db->quote('MEDIUMTEXT') . ',' . $this->db->quote('LONGTEXT') . ')';
$typeCheck = 'UPPER(type) IN (' . $this->db->quote('MEDIUMTEXT') . ',' . $this->db->quote('LONGTEXT') . ')';
}
else
{
$typeCheck = 'type = ' . $this->db->quote($uType);
$typeCheck = 'UPPER(type) = ' . $this->db->quote($fixedType);
}
}
else
{
$typeCheck = 'type = ' . $this->db->quote($uType);
$typeCheck = 'UPPER(type) = ' . $this->db->quote($fixedType);
}

return $typeCheck;
Expand Down

0 comments on commit 32711a0

Please sign in to comment.