You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was working on some overhaul of my models when I got a weird issue when I did a multiple associations for a pretty big model. The 2 previous associations worked fine but the last one didn't, which is a model with a few not null fields, complained that I didn't supply the not null field values. And I don't think I should. Anyway, here's the error I got:
farm_handler.go:156 NOT NULL constraint failed: hauler_user_details.business_address_municipality_id
[0.000ms] [rows:0] INSERT INTO hauler_user_details (id,created_at,updated_at,deleted_at,for_user_id) VALUES ("e9d6e156-0aae-4798-9572-85ecb4f78c8e","2024-11-28 12:01:20.293","2024-11-28 12:01:20.293",NULL,"") ON CONFLICT DO NOTHING RETURNING id,business_name,business_address_street,business_address_subdivision,business_address_sitio,business_address_barangay,business_address_municipality_id,business_address_province_id,business_address_region_id
farm_handler.go:156 NOT NULL constraint failed: hauler_user_details.business_address_municipality_id; NOT NULL constraint failed: hauler_user_details.business_address_municipality_id
[2.120ms] [rows:1] UPDATE farms SET updated_at="2024-11-28 12:01:20.292" WHERE farms.deleted_at IS NULL AND id = "4dc0ef0f-9335-4d1a-a540-dff51e55f09c"
When I did supply the not null fields, the association worked
The text was updated successfully, but these errors were encountered:
rickyManalo
changed the title
Associating to a model with a not null field shouldn't be required during association
Associating to a model with a not null field shouldn't be require those fields during association
Nov 28, 2024
rickyManalo
changed the title
Associating to a model with a not null field shouldn't be require those fields during association
Associating to a model with a not null field shouldn't require those fields during association
Nov 28, 2024
Describe the feature
I think the title already describes what I want.
Motivation
I was working on some overhaul of my models when I got a weird issue when I did a multiple associations for a pretty big model. The 2 previous associations worked fine but the last one didn't, which is a model with a few not null fields, complained that I didn't supply the not null field values. And I don't think I should. Anyway, here's the error I got:
When I did supply the not null fields, the association worked
The text was updated successfully, but these errors were encountered: