I added a column in a table (query below)
ALTER TABLE `acct_doc_item_data`
ADD fk_job_id INT(11),
ADD FOREIGN KEY (fk_job_id) REFERENCES `job`(`job_id`);
Now I want to drop this column (fk_job_id). I tried these queries but they are giving error.
ALTER TABLE `acct_doc_item_data` DROP FOREIGN KEY `fk_job_id`;
ALTER TABLE `acct_doc_item_data` DROP COLUMN `fk_job_id`;
1st Alter statement gives error as - Can't DROP 'fk_job_id'; check that column/key exists
(But the column exists).
2nd Alter statement gives error as - Cannot drop index 'fk_job_id': needed in a foreign key constraint