violates foreign key constraint

First of all I'm very much front end so this question may be dumb and don't be afraid to talk to me like I'm 5.

Ok so here's whats happening: I have an old sql database from like the free databases you get with GoDaddy that I made forever ago and I'm trying to migrate it to Supabase. All of my PK are Int8. I have a table students and the students have these scan cards for attendance so theres another table of cards with a FK of student_id.

The Problem: When I go to edit the FK student_id and add the foreign key relation in Supabase I get the error in the thumbnail.
Failed to run SQL Query: insert or update "cards" violates foreign key constraint "cards_student_id_fkey"

Any ideas or thoughts are helpful. I'm kind of a DB noob so feel free to come in with any and all ideas. Thanks!
unknown.png
Was this page helpful?