Hi,
in a table I’ve a field like payment_id CHAR(5) NOT NULL,
with fk
CONSTRAINT order_fk_payment FOREIGN KEY (payment_id) REFERENCES payment_method (payment_id) ON DELETE CASCADE ON UPDATE CASCADE
now I need to do on client request (there are customer with not payment_id)
ALTER TABLE order
MODIFY payment_id CHAR(5) default NULL,
so I’m wondering if I should get rid of the fk or not like
ALTER TABLE order DROP FOREIGN KEY order_fk_payment;
Modify the column to accept null and make sure your not going to mess up any unique key constraints that contain the payment_id – that is if any exists.