I have a database table called locations
and I need to add a new status
column. I have setup the following migration file which adds the field fine when i run php artisan migrate
, but how can I insert a value of Active
for each row in the table?
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddStatusToLocationsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('locations', function(Blueprint $table)
{
$table->string('status')->after('email');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('locations', function(Blueprint $table)
{
$table->dropColumn('status');
});
}
}