Fay*_*med 2 database-design laravel
我创建了一个 post_id 未签名的迁移。如何在新迁移中编辑 post_id 以使其也成功nullable()?
Schema::create('throttle', function(Blueprint $table)
{
$table->increments('id');
$table->integer('post_id')->unsigned(); // this needs to also be nullable, how should the next migration be?
}
Run Code Online (Sandbox Code Playgroud)
创建 migrate 并添加您的 up 函数,如下所示:
$table->integer('post_id')->nullable()->change();
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5506 次 |
| 最近记录: |