Rip*_*din 4 php mysql laravel laravel-5.6
我尝试迁移项目的购买表
当我尝试迁移时,它显示表空间错误。
一般错误:1813 表 ' 的表空间
jshop
。purchases
' 存在。请在导入之前丢弃表空间。
迁移代码如下:
Schema::create('purchases', function (Blueprint $table) {
$table->increments('id');
$table->integer("product_price");
$table->integer("product_qty");
$table->unsignedInteger('invoice_id');
$table->unsignedInteger('product_id');
$table->unsignedInteger('weight_id');
$table->timestamps();
$table->foreign("invoice_id")->references('id')->on('invoices');
$table->foreign("product_id")->references('id')->on('products');
$table->foreign("weight_id")->references('id')->on('weights');
});
Run Code Online (Sandbox Code Playgroud)
错误消息图片如下: 迁移错误图片链接 如何解决此问题?
尝试这个:
php artisan migrate:refresh
Run Code Online (Sandbox Code Playgroud)
如果不能解决此错误,请尝试以下操作:
转到mysql/data/database_name /tablename.ibd file
并手动删除它。之后尝试你的命令php artisan migrate
归档时间: |
|
查看次数: |
15272 次 |
最近记录: |