SQL 1025 Foreign Key Constraint Error (152)

I keep getting an error message every time I try to drop a table called "countires" and a field called "countries".

#1025 - Error on rename of '.\mutli_page_form\survey' to '.\mutli_page_form\#sql2-820-1fb' (errno: 152) 

It says that there is a dependence of FK on the "survey" table, I tried to delete it several times so as not to succeed.

 #1217 - Cannot delete or update a parent row: a foreign key constraint fails 

Now I get this error while trying to delete the country table

+4
source share
2 answers

It was reported that the database ensures data integrity. This is what you see. There are survey data in which the country is indicated. If you delete the country table, the survey data will not have valid countries associated with it. You need to delete polls first before deleting countries.

+4
source

You should set the index as for id () in 2 tables -> after retrying

+1
source

Source: https://habr.com/ru/post/1344161/


All Articles