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
Creating a config with specific params, gorm handles the associations normally, However, if we wish to update the params of the existing config, gorm will create a new params instead with the correct configID and it will clear the configID from the old params which technically create garbage in the database, since those entries are now useless and they will live as ghost for the rest of the eternity.
@jinzhu A small example is attached. You can see the last entry in the active association of that config_id, and the previous one should have been deleted. Instead gorm, changes the config_id to null and keeps the entry. That will potentially create N of entries that will never be used anywhere.
If I add a new association this will happen to the existing data:
Let's say we have
Creating a config with specific params, gorm handles the associations normally, However, if we wish to update the params of the existing config, gorm will create a new params instead with the correct configID and it will clear the configID from the old params which technically create garbage in the database, since those entries are now useless and they will live as ghost for the rest of the eternity.
Trying to figure this out by reading https://gorm.io/docs/associations.html#Association-Mode, it seems that all operations related to associations are keeping garbage entries in the database.
This sounds like a BUG, or am I missing some critical configuration in the db session maybe?
The text was updated successfully, but these errors were encountered: