DT
Drizzle Team•10mo ago
igo

Can't insert uuid value in uuid foreign key

I'm trying to create a new row in my database, I have just two tables, a table called recollection and another called image. You guys can see the table schemas and the code snippet in the images. I'm just trying to create a new recollection after creating 3 images with a transaction, but I receive the error:
insert or update on table recollections violates foreign key constraint recollections_original_image_id_images_id_fk
insert or update on table recollections violates foreign key constraint recollections_original_image_id_images_id_fk
I already checked if the id is ok by logging it, and it is. PS: the extra values i'm passing in recollections insert exists, I hid them in the schema to fit in the print screen
No description
No description
No description
No description
3 Replies
igo
igoOP•10mo ago
Should I create an issue in gh?
Mykhailo
Mykhailo•10mo ago
Hello, @igo! I think it is because you use recollectionDb instead of tx. Try to rewrite it on tx
No description
igo
igoOP•10mo ago
Oooh sure! My bad haha 😆 Thank you so much! It works now.
Want results from more Discord servers?
Add your server