If you make changes like adding / deleting a column from some table, it is recommended to create a new migration similar to that
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddColumnOwnerToLikes extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('likes' , function(Blueprint $table){
$table->integer('user_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
After creating the migration run the command:
php artisan migrate
soon after execution your new column will be created or deleted.
With the commands:
php artisan migrate:refresh
php artisan migrate:reset
Data will be erased as all tables will be deleted and recreated