vendredi 15 mai 2020

Using new migrations on laravel database app that already has partial migrations and manual edits

I have a Laravel 5.5 app with NGINX database. I develop locally using Laragon and commit to the production server in Forge using SourceTree/BitBucket. The "production" server is not "public" in that it's not available to the public so no worries about live users. Everything works well, though I've been through hell at times figuring out issues syncing up dev to production with composer issues running artisan through SSH, but its been stable and operational for about a year.

My question is this. I haven't used migrations in some time. I manually built or modified tables, models and controllers for my app as I was terrified of breaking things. While both dev and production have identical repositories of migration files, and database migration records, if I use a migration now because I want to add a completely new CRUD section to my app, will artisan's migrate command adversely effect changes made manually in the app and database that are not in the migration history? I'm not concerned about changing or rolling back any of the manually edited work, just want to make sure new migrations don't conflict with it, or should I stick with the manual build?

I guess another way to ask this is, does a new migration only process it's changes, or does artisan re-run past migrations and reset manual edits?

So, if I use Artisan to create a new migration to add a new table and model locally, sync via SourceTree and run artisan migrate on the production server, should I be ok? Or do I need to run artisan migrate first on both ends before the files sync? Or should I not risk it?

Any recommendations are very welcome.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire