【发布时间】:2021-03-29 05:26:08
【问题描述】:
我对工匠修补匠有疑问 问题:
Illuminate\Database\QueryException with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'homestead.projects' doesn't exist (SQL: insert into `projects` (`title`, `description`, `updated_at`, `created_at`) values (My first Project, bla bla, 2020-12-18 14:21:42, 2020-12-18 14:21:42))'
我的迁移文件:
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class BusinessTable extends Migration
{
/**
* Выполнение миграций.
*
* @return void
*/
public function up()
{
Schema::create('flights', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('mail');
$table->string('web-site');
$table->timestamps();
});
}
/**
* Отмена миграций.
*
* @return void
*/
public function down()
{
Schema::drop('business');
}
}
【问题讨论】:
-
.env文件中的数据集是否正确?您是否使用php artisan migrate运行迁移?
标签: laravel laravel-artisan migrate artisan-migrate tinker