Assume we have four tables
employee, employee_history, employee_details, emp_details_history
employee_history is a duplicate of employee emp_details_history should be the duplicate of employee_details
Instead of referring employee_history in emp_details_history people have referred employee table and created column and has values as well.
Now i want to change the foreign key column name of employee_details_history to point to employee_history instead of emp_details.
employee_details_history has COLUMNS pkey AND employee_id (instead of pkey AND employee_history_id)
the system is not allowing to delete the employee record as it is referred in the history table. history is different and actual record should be different.
Now would like to point to the correct column and name.
could you please help me how to change the foreign key column and name?
Thanks in advance.