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
When using the statement below, some fields on associated table are been updated to null. database.Db.WithContext(ctx).Session(&gorm.Session{FullSaveAssociations: true}).Clauses(clause.Returning{}).Updates(&client)
On this particular case I´m updating the statusCode on table PersonAddress but i don´t know what the transaction will update, it can update the person table and the table address, can create a new address and so on.
Now the scenarios that are working and not working are:
Updating just the parent table (works)
Updating the parent table and creating a new association record (works)
Updating the some parent table fields (works) but when updating some fields on the association it makes null all the other values not passed
The document you expected this should be explained
I need a clear example on how I can use Updates with Association to make a full merge with what is in the database and what the user is updating/inserting.
The text was updated successfully, but these errors were encountered:
Your Question
When using the statement below, some fields on associated table are been updated to null.
database.Db.WithContext(ctx).Session(&gorm.Session{FullSaveAssociations: true}).Clauses(clause.Returning{}).Updates(&client)
Here is my model:
On this particular case I´m updating the statusCode on table PersonAddress but i don´t know what the transaction will update, it can update the person table and the table address, can create a new address and so on.
Now the scenarios that are working and not working are:
The document you expected this should be explained
This doubt should be explanied on
Expected answer
I need a clear example on how I can use Updates with Association to make a full merge with what is in the database and what the user is updating/inserting.
The text was updated successfully, but these errors were encountered: