Search
 
SCRIPT & CODE EXAMPLE
 

PHP

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
Comment

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
Comment

PREVIOUS NEXT
Code Example
Php :: php crud generator 
Php :: get id from object 
Php :: pessimistic locking laravel 
Php :: page.php woocommerce 
Php :: How to insert header in php 
Php :: Laravel whereHas with count 
Php :: how to use concat in laravel 
Php :: auth user with relation laravel 
Php :: which is file attributes in php 
Php :: php replace url parameter value 
Php :: serve https with php local 
Php :: adding two numbers in php 
Php :: list function php 
Php :: if else in one line php 
Php :: reset admin password magento 2 
Php :: how to split sting in php 
Php :: loop through objects in php 
Php :: Remove White Space At Sides 
Php :: connect php to db 
Php :: insert into php myqsl 
Php :: php ascii to decimal 
Php :: php array_search 
Php :: blocked token vs expired token 
Php :: route parameter type laravel 
Php :: php artisan migrate stuck 
Php :: wordpress remove noindex programmatically 
Php :: @forelse laravel 
Php :: aravel cache store does not support tagging 
Php :: membership_registration: city or town 
Php :: php replace all text from string with associate array values 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =