Is it possible to add a constraint to a table once it has already been created?
Here is my table:
Code:
id int not null primary key auto_increment,
first_name varchar(25) not null,
last_name varchar(25) not null,
job_id int,
department_id int,
supervisor_id int
I want to add a recursive constraint that references the supervisor_id to the id column.
I tried:
Code:
alter table employees add constraint super_emp foreign key (supervisor_id) references id;
I get an error 1005 saying that I can't create a table.
Thanks for your help.