Unverified Commit 70924a83 authored by belgattitude's avatar belgattitude Committed by Luís Cobucci

Removed unused use statement

parent b075331d
...@@ -26,7 +26,6 @@ use Doctrine\DBAL\Schema\Table; ...@@ -26,7 +26,6 @@ use Doctrine\DBAL\Schema\Table;
use Doctrine\DBAL\Schema\TableDiff; use Doctrine\DBAL\Schema\TableDiff;
use Doctrine\DBAL\Types\BlobType; use Doctrine\DBAL\Types\BlobType;
use Doctrine\DBAL\Types\TextType; use Doctrine\DBAL\Types\TextType;
use Doctrine\DBAL\Types\Type;
/** /**
* The MySqlPlatform provides the behavior, features and SQL dialect of the * The MySqlPlatform provides the behavior, features and SQL dialect of the
...@@ -460,27 +459,15 @@ class MySqlPlatform extends AbstractPlatform ...@@ -460,27 +459,15 @@ class MySqlPlatform extends AbstractPlatform
return $sql; return $sql;
} }
/**
* Tells whether a field type supports declaration of a default value.
*
* MySQL (as of 5.7.19) does not support default values for Blob and Text
* columns while MariaDB 10.2.1 does.
*/
protected function isDefaultValueSupportedForType(Type $field) : bool
{
return ! $field instanceof TextType && ! $field instanceof BlobType;
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getDefaultValueDeclarationSQL($field) public function getDefaultValueDeclarationSQL($field)
{ {
// Unset the default value if the given field type does not allow default values. // Unset the default value if the given field definition does not allow default values.
if (! $this->isDefaultValueSupportedForType($field['type'])) { if ($field['type'] instanceof TextType || $field['type'] instanceof BlobType) {
$field['default'] = null; $field['default'] = null;
} }
return parent::getDefaultValueDeclarationSQL($field); return parent::getDefaultValueDeclarationSQL($field);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment