Hi, I have always used laravel in projects with existing databases, but now I'm creating a project using migrates.
I often create a migrate and run it, forgetting to enter a column, once it's done, how do I re-run it to add the missing column?
For example, if I have this migration already executed on db:
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email')->unique();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
And I forgot the "avatar" column, it becomes:
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email')->unique();
$table->string('password');
$table->string('avatar')->nullable();
$table->rememberToken();
$table->timestamps();
});
how do I make it re-run? Artisan give me an error because the table already exists...