So im doing some refactoring and its better if the navigability is set to both refer to each other (i know this is not good for performance but that doesnt matter in this case). Does the database action mendix performs when you run it cover the change in the association table for all previous records? or should i also run a script to properly link previous tables (there are quite some). I know in older versions you actually had to commit both sides for the navigability(owner to both) to be stored in a 1 to 1 (even though its a stored in an association table which would technically require 1 commit and i think that was some fix later on) but i am unfamiliar with the logic in the association table regarding many to many and wihle there is already lots of data setting it to both refer to each other and hopefully the database action that goes through the records on the SQL side and creates extra records in the association table? EDIT: im asking here to quickly get an answer, if someone hasnt tried it before im going to just go through the SQL calls mendix sends to the database (if you set the log levels to trace) on the synchronize database call from mendix, in case that's my go to action im interested if anyone knows which log level that is? Connectionbus? Connectionbus_Queries? Connector?
Leon de Kuiper
This has never been the case: “I know in older versions you actually had to commit both sides for the navigability(owner to both) to be stored in a 1 to 1 (even though its a stored in an association table which would technically require 1 commit and i think that was some fix later on)”
The only issue has been that when setting the association, without commit; the other side of the 1-1 wasn't yet aware of the set association. Workaround was there to set the association from both sides in memory. After both have been committed; the association can be navigated from bot sides; not saying that from both sides the association needed to be commit ;-)
If you change a 1-* to a *-* there is no need to do any scripting or alike.
Changing a *-* to *-* both no scripting needed
Changing a *-* to 1-* don't even start doing that. unless you are really, really, really sure (and even then) there are only references stored as 1-*. better to add a 2nd association and iterarte over existing data to convert.