php - Laravel 迁移错误:找不到基表或视图
问题描述
我收到以下错误。我该如何解决?
未找到基表或视图:1146 表 'account_infos'
移民
public function up()
{
Schema::create('account_info', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('users_id');
$table->foreign('users_id')->references('id')
->on('users')->onDelete('cascade');
$table->unsignedBigInteger('axis_id');
$table->foreign('axis_id')->references('id')
->on('axis')->onDelete('cascade');
$table->enum('account_type',['legal','rightful']);
$table->timestamps();
});
}
解决方案
只需添加:
protected $table='account_info';
在你的模型中
推荐阅读
- sql - 使用 DISTINCT 内连接 SQL
- django - 在 django 和 postgres 中实现类似的系统
- python-3.x - 使用 cython/numba 进行 Pandas groupby 聚合
- javascript - 如何使用angular8切换行
- java - ActiveMQ InactivityMonitor 参数未应用于 HTTP 传输连接
- ios - 如何解决此冲突的一致性错误?
- javascript - vscode javascript 保留关键字语法颜色
- r - 如何从网站获取表格(scrappin)
- java - Java - 根据唯一 ID 收集、删除类的属性(全部扩展超类)
- python - Django url调度程序调用错误的函数