Answers for "how to migrate new column without empty the table in laravel"

PHP
0

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
Posted by: Guest on August-01-2020
0

how to migrate new column without empty the table in laravel

php artisan make:migration add_shipped_via_and_terms_colums_to_purchase_orders_table --table=purchase_orders
Posted by: Guest on August-01-2020

Code answers related to "how to migrate new column without empty the table in laravel"

Browse Popular Code Answers by Language