【发布时间】:2020-04-01 14:05:36
【问题描述】:
我该如何解决这个问题我已经尝试了所有可能的解决方案,但什么也没发生。只是显示相同的错误
错误 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');
}
}
【问题讨论】:
-
能否请您发布完整的错误