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
|
I'm new to LightSpeed, and I'm using the latest v5 release. I'm developing database first (SQL Server 2012). I've dragged all of the tables from my database into my LS model, but not all of the relationships have resulted in associations in the model. A number of the one-to-many relationships that definitely exist in the database simply aren't in the model. I've been left with isolated tables in the model. Also... I'm sure previous attempts at modeling in this way resulted in through associations being created automatically, but none have been created this time around. Can anyone explain what might be happening? Why might the relationships being dropped/ignored? |
|
|
Ok. This is very strange. I removed the PK from one of the tables where the relationships were missing, and then immediately re-introduced it. When I did an "Update from Source" in the LS designer, it then alerted me to 8 new associations; the ones that were missing from the original generation. What's going on?! This is all very confusing... |
|
|
And if I perform an "Update Database...", without having made any changes to the model LS has automatically generated, I'm presented with the following messsage box: Your database does not contain a KeyTable table but you are using KeyTable or Default as an identity method for one or more entities in your model, do you wish to automatically create this table? Has LightSpeed somehow confused itself, internally? |
|
|
How do I get support for this issue? It's now holding up development. I've tried removing all table and re-adding them all to my model, but it still fails to create all of the associations that exist in the source database. Is support only available via these forums? |
|
|
Sorry Im not sure why it is not automatically inferring the associations. If you manually create them and then update the database what changes does it report it will make for the associated table? If you are able to send us through a copy of your schema so we can try and recreate this here I can have more of a look at whats going on. In terms of the key table message, do you have a KeyTable table in the database? We prompt to create this when it isn't present.
|
|
|
Hi Jeremy. Is it possible to send the schema to you outside of this forum? I'm not permitted to post it publicly. |
|
|
Yep you can email this through to us at support at mindscape.co.nz
|
|
|
Thanks - email sent. |
|
|
The associations are not being automatically inferred because they are part of the composite PK on the other entity in each case (e.g. OfferCategory, OfferId which is the FK is part of the PK). This runs counter to our conventions so we dont automatically pick this up, you need to wire this up yourself. There is a bit more detail about quirks with composite keys in the docs here: http://www.mindscapehq.com/documentation/lightspeed/Working-with-Legacy-Databases/Using-Composite-Keys To resolve this you need to make a couple of changes for each association in question:
|
|
|
Thanks for clearing this up for me. Coming from (the now defunct) EntitySpaces, I'm used to this stuff, well, just auto-wiring up. As I'm using a standard many-to-many implementation, I just expected it to work. Thanks for detailing a work-around though. Will I have to wire up each "through" association manually too, or will it be able to infer these from the many-to-many associations I add? [edit] No - it doesn't. I had to add the through associations manually too. [/edit] |
|