Hi. I need store the large file into mysql db so the longblob is needed. However, I see yii2 only suppport blob
Below is my code in migrate script.
$this->createTable(
'{{%media}}',
[
'id' => Schema::TYPE_PK,
'mime_type' => Schema::TYPE_STRING . ' NOT NULL ',
'size' => Schema::TYPE_STRING . '(32) NOT NULL',
'file_name' => Schema::TYPE_STRING . '(256) NOT NULL',
'data' => Schema::TYPE_BINARY . ' NOT NULL',
'created_at' => Schema::TYPE_INTEGER . ' NOT NULL',
'updated_at' => Schema::TYPE_INTEGER . ' NOT NULL',
'user_id' => Schema::TYPE_INTEGER
],
$tableOptions
);
I found only the Schema::TYPE_BINARY and you can see it’s assigned to data field which generate the shortblob.
so what’s the solution to generate field with longblob ?