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
|
If you configure a new entity with a key type of string and length say of 6. Then attempt creating a one to one association between a source table and the table containing the key type you get an error when updating the database. For Example: TABLE1 is called Images and has an int based key and some columns about the image for example FileName, Path, etc. TABLE2 is a reference table that lists the possible File Types, so the table is called FileTypes. In the FileTypes table I have set the Key type to string with a length of 6, which will hold the extension for example PDF. After these are created in the designer I drag a "one to one" association between them, but after attempting to update the database and create the needed columns and relationships I get the following error: - Column 'FileType.Id' is not the same length or scale as referencing column 'Images.FileTypeId' in foreign key 'FK_XXXXXX'. Columns participating in a foreign key relationship must be defined with the same length and scale. Could not create constraint. See previous errors. I saw a previous post about a very similar issue in 3.X here, but the only reply said that it would be fixed in the next drop... http://www.mindscapehq.com/forums/Thread.aspx?PostID=7473 Not sure if these are trully related, but I am on 4.X and seeing similar issues still with at least one to one associations. It appears that with a one to one, the column that lightspeed attempts to create in the images table is of type int, when the destination key is actually a string length of 6. Any help would be appreciated... |
|
|
Thanks for reporting this. You are quite right about the linked issue being the same, but the fix was applied only for one-to-many associations. I've now applied the fix to one-to-one associations too, so this should all work correctly in the next nightly build (available from about 1200 UTC). |
|
|
Ivan,
Appears that I am having the same issue when creating an AutoThroughEntity using the exact same entity design. Basically Table 1 has a string based key, the other end an int. When I link the tables and specify an Auto Through Entity the resulting database update results in an error that the Keys are not of the correct type and it kicks out.
|
|
|
By the way, thank you for fixing the previous issue... Think I forgot to put that in... |
|
|
Thanks for alerting us to this -- sorry we overlooked this scenario. It will be fixed in the next nightly build. |
|