Skip to content

The length field in yii\db\SchemaBuilderTrait::binary() is being ignored for mysql. #12618

@kanyuga

Description

@kanyuga

What steps will reproduce the problem?

Trying to create a LONGBLOB field via

$this->db->createCommand()->createTable("test_blob", [
    "id"    => $this->integer(),
    "datum" => $this->binary(4294967295), // LONGBLOB
    "txt"   => $this->string()
])->getSql();

What is the expected result?

CREATE TABLE `test_blob` (
    `id` int(11),
    `datum` blob(4294967295),
    `txt` varchar(255)
);

What do you get instead?

CREATE TABLE `test_blob` (
    `id` int(11),
    `datum` blob,
    `txt` varchar(255)
);

Additional info

Q A
Yii version 2.0.9
PHP version 7.0.9
Operating system Ubuntu 16.04
Source http://stackoverflow.com/questions/39721423/yii2-create-migration-with-longblob-field

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions