ruby - MYSQL setting Foreign Key ERROR 1452 (23000) -



ruby - MYSQL setting Foreign Key ERROR 1452 (23000) -

i have users , rota table in mysql database , trying add together set foreign key called user_id in rota table. error after executing line of code in terminal:

alter table rota add together foreign key (user_id) references users(id);

and error is:

error 1452 (23000): cannot add together or update kid row: foreign key constraint fails (sharp2_development.#sql-b19_ada, constraint #sql-b19_ada_ibfk_1 foreign key (user_id) references users (id))

i have user_id column in rota type int, no null, default no , no user table's id same apart beingness primary key , auto_increment.

mysql ruby database foreign-keys primary-key

Comments

Popular posts from this blog

maven fortify plugin : Unable to load build session with ID XXXXX .. See log file for more details -

c# - Primavera WebServices does not return any data -

android - Display emoji panel with genymotion - keyboard/touch input? -