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:
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 RETURNINGid,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_idfarm_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
farmsSETupdated_at="2024-11-28 12:01:20.292" WHEREfarms.deleted_atIS NULL ANDid= "4dc0ef0f-9335-4d1a-a540-dff51e55f09c"
When I did supply the not null fields, the association worked
Comment From: rickyManalo
I did some test and it seems like supplying those not null fields with a "default" value is a workaround