I dropped a foreign key constraint in users_id field, and wanted to set field value to allow NULL values, and DEFAULT NULL.
It seems like foreign key constraint has been removed, but somehow I cannot make the field NULL-able.
ALTER TABLE tbl_name DROP FOREIGN KEY `fk_internal_team_has_users_users1`; Here's the table schema after dropping foreign key:
CREATE TABLE `internal_team_head` ( `id` int(11) NOT NULL AUTO_INCREMENT, `internal_team_id` int(11) NOT NULL, `users_id` int(11) NOT NULL DEFAULT '0', `type` enum('lead','project_manager') NOT NULL, `updated_by` int(6) DEFAULT NULL, `updated_on` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`,`internal_team_id`,`users_id`,`type`), KEY `fk_internal_team_has_users_users1_idx` (`users_id`), KEY `fk_internal_team_has_users_internal_team1_idx` (`internal_team_id`), CONSTRAINT `fk_internal_team_has_users_internal_team1` FOREIGN KEY (`internal_team_id`) REFERENCES `internal_team` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB AUTO_INCREMENT=69 DEFAULT CHARSET=utf8 Now I want to change users_id to allow NULL values and default to NULL.
ALTER TABLE `internal_team_head` CHANGE `users_id` `users_id` INT(11) NULL DEFAULT NULL; The Alter query executes successfully but users_id Null attribute is still set to No and default value set to 0.
How do I enforce the changes?