var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Adding a constraint to table
Is it possible to add a constraint to a table once it has already been created?
Here is my table:
I want to add a recursive constraint that references the supervisor_id to the id column.
id int not null primary key auto_increment,
first_name varchar(25) not null,
last_name varchar(25) not null,
I get an error 1005 saying that I can't create a table.
alter table employees add constraint super_emp foreign key (supervisor_id) references id;
Thanks for your help.
You forgot to mention the referenced table in your alter table statement:
alter table employees
add constraint super_emp foreign key (supervisor_id)
Figures I'd do something stupid like that. Thanks