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 seriously looking at utilizing LS4’s migration features. I’ve had a play with it and now have a few questions I hope you could answer. (db is >= SQL2005) 1) Our entities identity method is set to default and the context is set to identity column (pks are auto seeding) When I generate a migration the tables are not adding the AsIdentityColumn command to the PK as I would have expected. If I change the entities Identity method from default to IdentityCoumn then the migration generates the PK correctly. Can this be corrected? 2) How can we handle SQL2005 timestamp data types? Migration treats them as objects and that causes a crash when it creates the column in SQL! 3) I can see how to get the current version of the db. Is there a way to get the versions contained in the migration package? Would like to know this before I execute the migration. 4) Must we handle the creation of indexes and sps ourselves using the ExecteNativeCommand? 5) If a migration fails does it rollback anything? 6) I see the Migration class has overrides for AddColumns etc but not for any of the add table methods. Would it be possible to add overrides to those add table methods? I would like to subclass the migration class and add a check to see if tables exist before adding them. Thanks |
|
|
This is deliberate, you need to have your identity method explicitely set to IdentityColumn to clearly indicate this as Default just means inherit the context setting at the time.
Set the data type to be Blob and mark the field as LoadOnly.
You can enumerate the Migration instances by running the migration in preview mode and attaching to one of the events on the Migrator instance you are working with. We dont have a direct IEnumerable you can work with though. Another way of achieving this would be to use Reflection to find this by just loading up all the types in the applicable assembly and scan for anything which inherits from Migration.
Yes
This has actually been updated very recently in a nightly build so if you grab the latest nightly this will be covered.
|
|