yocmen's avatar

migration flow for production

hi, my question is related with how i manage the flow of my project (git) and migration in laravel, on local dev o can migrate.. refresh... etc... but what about for production enviroment? how can i make the new changes (on existing tables or new tables) without affect my current data??? thanks.

0 likes
1 reply
bobbybouwmann's avatar
Level 88

You you need to create a migration for each change to your database. New migrations include for example an extra column in your users table. You should never run php artisan migrate:fresh on production, because it will delete everything and create everything again. You can only run php artisan migrate. Your migrations should never delete data, unless it's a table or column you don't use anymore!

1 like

Please or to participate in this conversation.