Search code examples
databaselaravelphpmyadminmigrationdatabase-migration

laravel change table in PHPMYADMIN without migration


I have several tables that I have created through migration. Then, what happens if I change the table structure directly from PHPMYADMIN without using migration? What if my backend team pulls my project, then runs the "php artisan migrate" command. Is the database on my backend team the same as the database that I have?


Solution

  • If you make changes through phpMyAdmin, these will only be visible to you. You should change the migrations, or if you can't change the original because you don't want to reset the database, you should create a new migration to alter the table. Check the documentation for altering tables here: https://laravel.com/docs/5.7/migrations#modifying-columns