How can I create a Mediumblob
within the Laravel schema builder ?
In the docs it says :
$table->binary(\'data\'); // BLOB equivalent
You can't.
This issue suggests using raw queries to create such columns, so you should do something like this in your migration file :
Schema::create("", function($table) {
// here you do all columns supported by the schema builder
});
// once the table is created use a raw query to ALTER it and add the MEDIUMBLOB
DB::statement("ALTER TABLE ADD MEDIUMBLOB");
- 热议问题