sql - 不能在 laravel 8 上使用 onUpdate 方法
问题描述
Schema::create('posts', function (Blueprint $table) {
$table->id();
$table->foreignId('author')->constrained('users')->onDelete('cascade')->onUpdate('cascade');
$table->timestamps();
});
onUpdate 没用??
解决方案
请像这样检查。
$table->foreignId('author')->constrained()
->onUpdate('cascade')
->onDelete('cascade');
推荐阅读
- .net - 什么决定了哪个程序集版本内置到 bin 文件夹中
- python - Spacy 短语匹配器 - 不可散列的类型:'dict'
- ruby - 如何从命令行为运行文件编写 Rspec 测试?
- c - kill(in c) VS getpid VS stat
- google-bigquery - bigquery 通配符表查询不允许选择某些字段
- r - Windows 二进制文件:r-devel:不可用和 macOS 二进制文件:r-release:不可用
- layout - 如何将 RadioBoxes 放在布局上?
- c - 将可变长度参数列表传递给另一个函数
- python - * UNIQUE 约束处的 IntegrityError 失败
- ios - 如何在 xamarin 表单地图中扩展 customPinWinod