thickas 2016-01-01 11:35:26 1547次浏览 0条回复 0 0 0

2.0文档中关于“数据迁移”,下面的代码与官方网站不一样,运行会出错:

$this->createTable('news', [

        'id' => Schema::primaryKey(),
        'title' => Schema::string()->notNull(),
        'content' => Schema::text(),
    ]);

正确应为: $this->createTable('news', [

        'id' => $this->primaryKey(),
        'title' => $this->string()->notNull(),
        'content' => $this->text(),
    ]);
    没有找到数据。
您需要登录后才可以回复。登录 | 立即注册