Database Migration
What are steps to be looked from cli command "php artisan migrate:refresh --seed" . First of as we this command will drop table migration from bottom to top . However in our case, we should declare a foreign key migration table exactly at bottom of the folder. This is to ensure we can drop child key and the relation of foreign key with another table before dropping parent keys.
DropForeign ( ) need to be call under Schema::table and with a blue print object
or
Next, after removing the relation and the key constraint of foreign key. Now we can drop the column inside the class table .
References :
https://stackoverflow.com/questions/41416993/call-to-undefined-method-illuminate-database-schema-mysqlbuilderdropforeign
https://laravel.com/docs/5.4/migrations
No comments:
Post a Comment