diff --git a/src/Processor/CreateProcessor.php b/src/Processor/CreateProcessor.php index 89b7d223..cb1acf80 100644 --- a/src/Processor/CreateProcessor.php +++ b/src/Processor/CreateProcessor.php @@ -163,7 +163,17 @@ private static function getDefinitionColumn(Query\MysqlColumnType $stmt) : Colum return new Column\Decimal($stmt->length, $stmt->decimals); case DataType::BINARY: + if ($stmt->length === null) { + throw new \UnexpectedValueException('length should not be null'); + } + + return new Column\Binary($stmt->length, 'binary', 'binary'); + case DataType::CHAR: + if ($stmt->length === null) { + throw new \UnexpectedValueException('length should not be null'); + } + return new Column\Char($stmt->length); case DataType::ENUM: diff --git a/src/Schema/Column/Binary.php b/src/Schema/Column/Binary.php new file mode 100644 index 00000000..aea72996 --- /dev/null +++ b/src/Schema/Column/Binary.php @@ -0,0 +1,9 @@ +