irankhosravi
1 month ago

How to migrate a table

Posted 1 month ago by irankhosravi

I tried migrate a products table but I do not successfully. I get this error.

table

products table :

public function up()
{
    Schema::create('products', function (Blueprint $table) {
        $table->bigIncrements('id');
        $table->bigInteger('user_id')->unsigned();
        $table->bigInteger('customer_id')->unsigned();
        $table->string('title');
        $table->string('file');
        $table->text('body');
        $table->string('price');
        $table->string('slug');
        $table->string('image');
        $table->timestamps();
        $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
        $table->foreign('customer_id')->references('id')->on('users')->onDelete('cascade');
    });
}

Please sign in or create an account to participate in this conversation.