TechZen
0
Q:

how to migrate new column without empty the table in laravel

Use below command to modify the existing table

php artisan make:migration add_shipped_via_and_terms_colums_to_purchase_orders_table --table=purchase_orders
use --create for creating the new table and --table for modifying the existing table.

Now a new migration file will be created. Inside the up() function in this file add these line

Schema::table('purchase_orders', function(Blueprint $table){
    $table->string('shipped_via');
    $table->string('terms');
});
And then run php artisan migrate
0
php artisan make:migration add_shipped_via_and_terms_colums_to_purchase_orders_table --table=purchase_orders
0

New to Communities?

Join the community