I am running into this error when i migrate.Is there any way to save data on my database.I know that dropping the auth_user table will fix the issue. I am running postgresql. Thanks!
FATAL ERROR - The following SQL query failed: ALTER TABLE "api_poi" ADD CONSTRAINT "user_id_refs_id_20f256ff" FOREIGN KEY ("user_id") REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED;
The error was: insert or update on table "api_poi" violates foreign key constraint "user_id_refs_id_20f256ff"
DETAIL: Key (user_id)=(1) is not present in table "auth_user".
There is a row in api_poi
which has user_id
set to 1, but there is no row in auth_user
which has id
set to 1.
So it is impossible to define a foreign key constraint like you are trying to do.
You will have to add rows to auth_user
or remove rows from api_poi
until the foreign key constraint is satisfied.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With