Jump to content

FOREIGN KEYs as well as PRIMARY KEYs


terryds

Recommended Posts

My query generates error. (errno:150)

 

CREATE TABLE userrole (
userid BIGINT NOT NULL,
roleid INT NOT NULL,
PRIMARY KEY(userid,roleid),
CONSTRAINT fk_userid FOREIGN KEY (userid) REFERENCES user(user_id),
CONSTRAINT fk_roleid FOREIGN KEY (roleid) REFERENCES role(role_id)
)
Please tell me how to solve it..
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...