SQLSTATE[42000]: Syntax error or access violation: 1059 Identifier name 'XXXXXX' is too long

创建migration 主键和索引的时候提示长度太长了,点开函数发现

 public function index($columns, $name = null, $algorithm = null)
    {
        return $this->indexCommand('index', $columns, $name, $algorithm);
    }

 public function primary($columns, $name = null, $algorithm = null)
    {
        return $this->indexCommand('primary', $columns, $name, $algorithm);
    }

第二个参数是name ,再[ ]后面加了个name 再migrate 

成功!

你可能感兴趣的:(SQLSTATE[42000]: Syntax error or access violation: 1059 Identifier name 'XXXXXX' is too long)