Search
 
SCRIPT & CODE EXAMPLE
 

PHP

how to refresh migration in laravel without losing 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."
Comment

how to refresh migration in laravel without losing data

php artisan make:migration add_mobile_no_columns_to_users_table --table=users
Comment

PREVIOUS NEXT
Code Example
Php :: ziparchive laravel not found 
Php :: learn php 
Php :: wp-admin File not found (404 error) 
Php :: how to save array of inputs in php 
Php :: php simple server 
Php :: print select mysql in php 
Php :: add method to laravel blade 
Php :: php izyboy 
Java :: import collectors java 
Java :: how to detect operating system in java 
Java :: java get next enum 
Java :: maven spring boot devtools install 
Java :: How do you nuke japan 
Java :: string to date conversion java 
Java :: java arraylist 
Java :: will my java minecraft be discontinued 
Java :: how to make javafx full screen default 
Java :: java try catch integer.parseint 
Java :: joptionpane.showconfirmdialog yes no example 
Java :: gravatar default 
Java :: array to map java 
Java :: JFrame Exit oon close Java15 
Java :: javafx action event enter key 
Java :: android studio edittext text change listener 
Java :: how to make plugin wait spigot 
Java :: processing draw circle 
Java :: how to print in java 
Java :: calculate pi in java 
Java :: display default value of auto commit java 
Java :: bouble to bytes[] java 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =