How to perform a Migration in Laravel, without excluding the other tables

Asked

Viewed 618 times

0

I’m new to both Laravel and Stack, recently I’m building a system and in the process I forgot to put a Migration.

Usually I put the remote php artisan migrate:refresh, however all the data that were using as test they are reset. The solution I found is to generate the table automatically in Mysql, but it takes a little time.

I wonder if there is any way to generate the migrate table, without zeroing the filled data.

  • Already tried running only php Artisan migrate?

1 answer

0


Unable to execute the php artisan migrate:refresh without erasing the data because the refresh recreates the entities of the database.

You can use Seeds and Factories to popular the database with examples using --seed

php artisan migrate:refresh --seed

If you want to add a new Migration, it is not necessary to use refresh, just use the php artisan migrate, your data will be maintained and the new entity will be created normally

Browser other questions tagged

You are not signed in. Login or sign up in order to post.