When i execute the below query it throws an error,
alter table `ttis`.`users`
add constraint `FK_Role_ID` FOREIGN KEY (`ROLE_ID`) REFERENCES `roles` (`ROLE_ID`)
Error:
Error Code : 1005
Can't create table 'ttis.#sql-9c_8a' (errno: 150)
When i execute the below query it throws an error,
alter table `ttis`.`users`
add constraint `FK_Role_ID` FOREIGN KEY (`ROLE_ID`) REFERENCES `roles` (`ROLE_ID`)
Error:
Error Code : 1005
Can't create table 'ttis.#sql-9c_8a' (errno: 150)
Have a look at this post: 13.6.4.4. FOREIGN KEY Constraints and search for "150". It says here: