如何Mediumblob
在Laravel模式构建器中创建一个?
在文档中说:
$table->binary('data'); // BLOB equivalent to the table
但是我需要一个MediumBlob,否则图像将在64K时被截断;我们正在运行MySQL。
我知道Laravel的架构生成器与数据库无关,但是有一种方法可以避免“本机方法”,如果没有,我该如何创建Mediumblob
列?
你不能
该问题建议使用原始查询来创建此类列,因此您应该在迁移文件中执行以下操作:
Schema::create("<table name>", 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 <table name> ADD <column name> MEDIUMBLOB");
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句