#1072 - Key column 'role_id' doesn't exist in table
You have to have the column you reference in add foreign key (
role_id)
inside your user table. Otherwise you get that error.
You would have to have inside your user table something like:
create table user(
...
role_id varchar(15)
...
)
Or if you don't have it, you have to do:
ALTER TABLE user ADD COLUMN role_id VARCHAR(15)
Before you set it as a foreign key.