If you make changes like adding/deleting a column from some table it is recommended to create a new Migration similar to this one
<?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 Migration run the command:
php artisan migrate
soon after the execution your new column will be created or deleted.
With the commands:
php artisan migrate:refresh
php artisan migrate:reset
data will be deleted as all tables will be deleted and recreated
got it... the strange thing is that in the course of an application these changes and Migrations can become uncontrollable ie, many Migrations for a table, which on top of that will have data. understands
– André Martins
You will have full control over your Migrations, just create when you need to change the structure of the tables and everything will be as before, just be careful not to make drastic edits that can prevent the operation of the application
– Vinicius Luiz