This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
This is my model (log from designer doing an update to the db, starting from empty db): This is when I just choose "Update database" afterwards (without having done any changes what-so-ever to the model: It seems like the designer thinks something needs to be updated, allthough there's no need to and fails, since items are already present. |
|
|
Hmm, while trying to reproduce this I've found a bug with through association sync, but unfortunately it's not the one you're seeing! Could you provide us with a source .lsmodel file to reproduce the problem? Thanks! |
|
|
File sent via email.
|
|
|
Hello Thomas, Thanks for the repro. The issue is that you are using a plural name for the through entity type, e.g. AddressTypeCodes rather than AddressTypeCode. The designer thinks that the AddressTypeCodes table in the database should be mapped to an AddressTypeCode entity in the model: it therefore incorrectly concludes that there's nothing in the database that maps to the AddressTypeCodes entity, and that a table needs to be created in the database for this entity. This is obviously a bug but there are a couple of easy workarounds. First, we would recommend that you give entity classes (including through entities) singular names, such as AddressTypeCode. If you do this, the designer will recognise the existing table mapping and the spurious create table prompt will go away. Your database structure will not be affected because the through table name will still be pluralised to AddressTypeCodes in the database. Second, if using a singular name is not acceptable, convert the through entity to an explicit through entity (you can do this by right-clicking on the arrow). The bug appears to be specific to auto through entities, so having an explicit through entity appears to bypass the bug. (It also opens the door to explicitly specifying a Table Name if you still see problems, though this wasn't necessary for me using your test data.) I'll log the bug -- thanks for reporting it! |
|