【发布时间】:2014-03-30 09:40:38
【问题描述】:
我需要将两个字段从整数更改为外键。我如何构建我的迁移来做到这一点?
Schema::create('messages', function($table)
{
$table->increments('id');
$table->integer('sender');
$table->integer('recipient');
$table->string('title');
$table->longtext('body');
$table->timestamps();
$table->softDeletes();
$table->integer('regarding');
});
我会将sender 更改为sender_id,将recipient 更改为recipient_id,将regarding 更改为regarding_id。
【问题讨论】: