Cannot drop column: needed in a foreign key constraint

Cannot drop column: needed in a foreign key constraint

Column, Drop, Foreign Key, MySQL

83 | 0 | 0

Solution:

Step 1: First drop foreign key constraint

ALTER TABLE `table_name` DROP FOREIGN KEY `column_foreign_key_constraint_foreign`;

Step 2: Then drop table column
ALTER TABLE `table_name` DROP COLUMN `column_name`;

Comments (0)

🤔

No comments yet, be the first to help

Welcome to CodePits.

CodePits provide a collection of tutorials about many programming languages like PHP, Laravel Framework, Codeigniter Framework, Mysql Database, Bootstrap Front-end Framework, Jquery, Node JS, Ajax Example, APIs, CURL Example, Composer Packages Example, AngularJS, Ionic Framework, etc. 🙌

Other Posts

Categories

Tags

Comment