MyirLik's avatar

Migrate without lose data

How can I migrate a column without losing data? If I create a new column in migration and if I try to migrate, I will receive this message: "nothing to migrate". How can I migrate without

php artisan  migrate:refresh
0 likes
2 replies
vumanhtrung's avatar

You need to create new migration for adding column

php artisan make:migration add_votes_to_users_table --table=users

Add new column

Schema::table('users', function (Blueprint $table) {
    $table->integer('votes');
});

Final, running artisan

php artisan migrate

Please or to participate in this conversation.