ОШИБКА 1005: Невозможно создать таблицу (ошибка: 150) - PullRequest
0 голосов
/ 01 апреля 2020

Как я могу решить эту проблему? Я перепробовал все возможные решения, но ничего не произошло. Точно такая же ошибка:

ОШИБКА 1005: Невозможно создать таблицу (номер ошибки: 150)

это код:

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAttributeValueProductAttributeTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
    */
    public function up()
    {
        Schema::create('attribute_value_product_attribute', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('attribute_value_id')->unsigned();
            $table->foreign('attribute_value_id')->references('id')->on('attribute_values');
            $table->bigInteger('product_attribute_id')->unsigned();
            $table->foreign('product_attribute_id')->references('id')->on('product_attributes');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('attribute_value_product_attribute');
    }
}

1 Ответ

0 голосов
/ 01 апреля 2020
    $table->increments('id');
        $table->integer('attribute_value_id')->unsigned();
        $table->foreign('attribute_value_id')->references('id')->on('attribute_values');
        $table->integer('product_attribute_id')->unsigned();
        $table->foreign('product_attribute_id')->references('id')->on('product_attributes');$table->timestamps();

, пожалуйста, скопируйте и вставьте это как есть, и дайте мне знать, что это работает для вас или нет, если нет, пожалуйста, дайте мне точную ошибку. спасибо

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...