【发布时间】:2017-08-02 14:13:21
【问题描述】:
我成功创建了迁移,但在数据库中看不到表,当我选择“PHP artisan migrate”时,我遇到了一个错误:
未找到基表或视图: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');
}
}
我应该怎么做才能解决这个问题?
【问题讨论】:
标签: laravel