Laravel 数据库迁移文件内如何对字段和表写注释?
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id')->comment('用户id');
$table->string('name')->comment('用户名');
$table->string('email')->unique()->comment('邮箱');
$table->timestamp('email_verified_at')->nullable()->comment('Email验证时间');
$table->string('password')->comment('密码');
$table->rememberToken()->comment('记住我');
$table->timestamps();
});
DB::statement("ALTER TABLE 'users' comment'用户表'");//表注释
}
这样写会提示语法冲突
我也是这么写啊,但是我的没有报语法冲突