我有一个创建迁移的任务,即将2个WorkRoom实例添加到数据库中,在创建模型并将其添加到表3字段时,我已经创建了一个迁移,但我不知道该怎么做现在。
class CreateWorkRoomsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('work_room', function (Blueprint $table) {
$table->bigIncrements('id');
$table->timestamps();
$table->integer('building')->nullable();
$table->integer('floor')->nullable();
$table->integer('office_number')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('work_room');