我的架构中有字段名称键和值。当我执行迁移命令时,它在我的 sql 表中用方括号将我的字段键和值括起来。在 sql 表中迁移后创建的字段示例如下所示:
[核心价值]
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class check extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('api_keys',function(Blueprint $table){
$table->string('value',255)->comment = "Key Value";
$table->integer('Level')->nullable()->comment = "Key Level";
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('api_keys');
}
}
我已经尝试了所有可能的解决方案,但仍然无法弄清楚在我的 sql 表中用方括号将字段“[key]”和“[value]”括起来的原因。