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 using SQL Server 2008. I went and got the latest build (uninstalled 2.2 production version first) to see if it fixed a few problems I was seeing when I had the designer create the DB tables (specifically that it didn't respect the nullability of columns). I'm using the CreatedOn column, and now when I try to do an Update Database I get "SQL Server cannot add column CreatedOn unless it is made nullable" for each table that uses it. I also get that same error for some of my own non-nullable properties. That's a big problem. In a small test project I turned off "Track Create Time" on my entities and it was able to create all the tables. However, this workaround is infeasible for me because my real project has many entities. Also, the model contains a one-to-many relationship for which IsNullable=False but the FK column gets generated as nullable. A bit of fiddling around and I found I was able to make them non-nullable by doing a third Update Database. That's more of an annoyance or documentation deficiency than a problem. Any plans on reducing the number of calls to Update Database to fully create the tables? Or am I doing it wrong? |
|
|
Thanks for letting us know about these issues. The reluctance to create non-nullable columns (such as CreatedOn) was, if I remember correctly, a somewhat over-defensive response to database exceptions when adding non-nullable columns to tables that already had data in them. In retrospect we should just have let the database go ahead and try it, and the attempt failed due to existing data, so be it. I'll get this fixed for you. I'll also investigate the "foreign keys incorrectly created as nullable" issue. Thanks again for reporting this. |
|
|
I have committed fixes for these issues and they will be included in nightly builds dated 15 Apr 2009 and above, available from about 1430 GMT. Note that creating tables with associations is still a two-step process -- first create the tables, then update them with the associations. This is due to us not currently managing the order of table creation. We hope to fix this in a future version. Please let us know if you still see problems. |
|