AnAlien's avatar

How do private Laravel migration for database ?

migrate:refresh

Yes, this command is really nice. But it erases the data in the table. However, it deletes the data in the table. Do you know a method to back up data and then "refresh"?

0 likes
3 replies
alanholmes's avatar

Hi @analien

I don't think there is a way to do what you are after, as it is kind of against the point of refresh which is to completely rebuild the DB from scratch (and only meant to local dev really).

You could use Seeders to will the tables back up with sample data if it is for local development, but it wouldn't be the data that was in there before you ran fresh, but you would always go back to the same starting point with the seeders.

AnAlien's avatar

Someone seemed to have published a plugin on github for "migrate: refresh". I don't remember it name.

Please or to participate in this conversation.