“cara menyegarkan migrasi di Laravel tanpa kehilangan data” Kode Jawaban

cara menyegarkan migrasi di Laravel tanpa kehilangan data

"Since you already have data in your tables then instead of rolling back your migrations (which will cause existing data losses) 
you can create new migration files to update your tables. Suppose you have a table users with columns name, email, password. 
You stored data in that table. Then you realized that you also do need to add a new column named mobile_no to your users table. 
To do this you need to create a new migration file. Command will be:"

php artisan make:migration add_mobile_no_columns_to_users_table --table=users
  
  
"This way a new migration file will be created. Set your column details there, 
run the migrations using php artisan migrate and that's all. You'll have this new column in your users table without losing previously 
stored data."
Selfish Skipper

cara menyegarkan migrasi di Laravel tanpa kehilangan data

php artisan make:migration add_mobile_no_columns_to_users_table --table=users
Selfish Skipper

Jawaban yang mirip dengan “cara menyegarkan migrasi di Laravel tanpa kehilangan data”

Pertanyaan yang mirip dengan “cara menyegarkan migrasi di Laravel tanpa kehilangan data”

Lebih banyak jawaban terkait untuk “cara menyegarkan migrasi di Laravel tanpa kehilangan data” di PHP

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya