Update DB drivers

Remove the checks that are not needed after the previous commit.
This commit is contained in:
Visman 2021-12-20 19:44:57 +07:00
parent 1d28b4f8c8
commit 5b5fedde23
3 changed files with 1 additions and 6 deletions

View file

@ -333,7 +333,6 @@ class Mysql
public function addField(string $table, string $field, string $type, bool $allowNull, /* mixed */ $default = null, string $after = null, bool $noPrefix = false): bool
{
$this->nameCheck($table);
$this->nameCheck($field);
if ($this->fieldExists($table, $field, $noPrefix)) {
return true;
@ -357,7 +356,6 @@ class Mysql
public function alterField(string $table, string $field, string $type, bool $allowNull, /* mixed */ $default = null, string $after = null, bool $noPrefix = false): bool
{
$this->nameCheck($table);
$this->nameCheck($field);
$table = ($noPrefix ? '' : $this->dbPrefix) . $table;
$query = "ALTER TABLE `{$table}` MODIFY " . $this->buildColumn($field, [$type, $allowNull, $default]);
@ -395,7 +393,6 @@ class Mysql
{
$this->nameCheck($table);
$this->nameCheck($old);
$this->nameCheck($new);
if (
$this->fieldExists($table, $new, $noPrefix)

View file

@ -315,7 +315,6 @@ class Pgsql
public function addField(string $table, string $field, string $type, bool $allowNull, /* mixed */ $default = null, string $after = null, bool $noPrefix = false): bool
{
$this->nameCheck($table);
$this->nameCheck($field);
if ($this->fieldExists($table, $field, $noPrefix)) {
return true;

View file

@ -145,7 +145,7 @@ class Sqlite
$query .= ' DEFAULT ' . $this->convToStr($data[2]);
}
// сравнение
if (\preg_match('%^(?:CHAR|VARCHAR|TINYTEXT|TEXT|MEDIUMTEXT|LONGTEXT|ENUM|SET)%i', $data[0])) {
if (\preg_match('%^(?:CHAR|VARCHAR|TINYTEXT|TEXT|MEDIUMTEXT|LONGTEXT|ENUM|SET)\b%i', $data[0])) {
$query .= ' COLLATE ';
if (
@ -304,7 +304,6 @@ class Sqlite
public function addField(string $table, string $field, string $type, bool $allowNull, /* mixed */ $default = null, string $after = null, bool $noPrefix = false): bool
{
$this->nameCheck($table);
$this->nameCheck($field);
if ($this->fieldExists($table, $field, $noPrefix)) {
return true;