I am using Laravel 5.5 and i would like to add an extra column to an existing table called users
.
The problem is that php artisan migrate
doesn't add the extra column.
1) Is it possible since table is not empty?
2) Why the below code block doesn't work?
By running php artisan make:migration update_users_column --table=users
a file is created :
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class UpdateUsersColumn extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->boolean('email_sent_to_user', true);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
// Schema::table('users', function (Blueprint $table) {
// //
// });
}
}
After running php artisan migrate
the migrations
table is updated but users
table is not updated.