KidViciou$
Diamond Member
i'm trying to add foreign key constraints on already created tables:
ALTER TABLE users ADD ( FOREIGN KEY ( role ) REFERENCES user_rights (role) ON DELETE SET NULL )
the error i'm getting is this:
#1005 - Can't create table './cmsc345_test2/#sql-d8b_416.frm' (errno: 150)
i'm sure that the data in the role column of table users is also in user_rights, but just to make sure i deleted all entries from users. can anyone enlighten me as to why such a simple statement is erring?
ALTER TABLE users ADD ( FOREIGN KEY ( role ) REFERENCES user_rights (role) ON DELETE SET NULL )
the error i'm getting is this:
#1005 - Can't create table './cmsc345_test2/#sql-d8b_416.frm' (errno: 150)
i'm sure that the data in the role column of table users is also in user_rights, but just to make sure i deleted all entries from users. can anyone enlighten me as to why such a simple statement is erring?