【问题标题】:Mysql Database Migration Error in LaravelLaravel中的Mysql数据库迁移错误
【发布时间】:2020-08-16 23:36:39
【问题描述】:
<?php

use Illuminate\Database\Migrations\Migration;

use Illuminate\Database\Schema\Blueprint;

use Illuminate\Support\Facades\Schema;

class CreatePostsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('posts', function (Blueprint $table) {

            $table->bogIncrements('id');

            $table->unsignedBigInteger('user_id');

            $table->string('caption');

            $table->string('image');

            $table->timestamps();

            $table->index('user_id');

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()

    {

        Schema::dropIfExists('posts');

    }

}

【问题讨论】:

    标签: mysql database eloquent database-migration laravel-7


    【解决方案1】:

    $table-&gt;bogIncrements('id'); 在这里打错了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-10-01
      • 2015-03-02
      • 2019-04-25
      • 1970-01-01
      • 2019-11-18
      • 2018-11-01
      • 2019-01-15
      相关资源
      最近更新 更多