我创建迁移成功,但不能查看数据库中的表,当我去“PHP工匠迁移”我面临着一个错误说:基表或视图未找到:1146
基表或视图不发现:1146 pakishops.advertisement不存在。
这里是迁移代码:
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateAdvertisementTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('advertisement', function (Blueprint $table) {
$table->increments('id');
$table->integer('shop_id')->unsigned();
$table->foreign('shop_id')
->references('id')
->on('shops')
->onDelete('cascade');
$table->string('image')->default('default.jpg');
$table->datetime('starting_date');
$table->datetime('ending_date');
$table->boolean('is_paid');
$table->boolean('is_active');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('advertisement');
}
}
我应该怎么做来解决这个问题?
感谢阿列克谢Mezenin你是真正有用的 –
@AsifNawaz如果这回答了你的问题,请你将其标记为正确的:) –
@AsifNawaz请接受的答案... –