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

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -