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
|
Hi, We are using LS4 and Sql Server 2005/2008. I have database called DatabaseA, and in DatabaseA I have a table TableA with an Id column which I set to PK with int type and I also set Identity Specification to yes, (Is Identity) to Yes, Identity Increment to 1, and Identity Seed to 1 from SQL server management studio. Then I connect to DatabaseA, and create LightSpeed model. That is fine. After that, I create migration project and run the migration against an empty database called DatabaseB from the designer. Then I can see TableA is in DatabaseB. However, the Id column does not have these settings (Identity Specification to yes, Is Identity to Yes, Identity Increment to 1, and Identity Seed to 1) as I set in DatabaseA. So my question is: how do I get those Identity Settings after the migration process. I am not using KeyTable. Thanks Xiaosu |
|
|
I find out that if I do this:
I will get all these identity settings in DatabaseB. But I have to add this AsIdentityColumn() call manually, how can I have this automatically when the migration class is generated? Thanks Xiaosu |
|
|
Make sure you have explicitly set the IdentityMethod on your entity to "IdentityColumn" as it will be set to "Default" by default - this will then carry through to the migration code.
|
|