laravel - Illuminate \ Database \ QueryException (42P01) SQLSTATE[42P01]: Undefined table: 7 ERROR: relationship "suggesteds" does not exist LINE 1
问题描述
我试图使用此处的代码在 laravel 中创建迁移。但不幸的是,它会弹出一个像这里给出的错误。
我使用 PostgreSQL 9.2.24
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSuggestedsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('suggesteds', function (Blueprint $table) {
$table->increments('id');
$table->integer('channel_id')->unsigned()->index();
$table->string('group')->nullable()->index(); // 'technology',
'lifestyle', etc.
$table->string('language')->default('en')->index();
$table->integer('z_index')->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('suggesteds');
}
}
在我使用 MySQL 并且没有它的错误之前。任何帮助将不胜感激。
解决方案
请用:
php artisan migrate:refresh
推荐阅读
- ios - 在iOS中,当应用程序处于后台状态时如何重新打开应用程序?
- perl - 查询 Perl 输出
- oracle - 如何提高oracle中的单次插入性能
- python-3.x - 在随机森林中使用 predict() 与 predict_proba() 计算时,ROC_AUC_SCORE 不同
- python - 比较两个列表以获取不匹配的元素
- python - 如何在多维数据上显示 K 均值聚类的输出?
- grep - 如何使用 grep 从日志文件中提取 IP 地址和日期/时间字符串?
- time - 23:59:60 什么时候是编程的有效时间?
- python - IxNetwork python 库:在加载的 ixncfg 文件中看不到流量项
- c# - 如何删除 csv 文件中管道字符串之间的逗号,例如 |Ana "ana" Ana|, |adda,adda|