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
|
After I create a Migrations project with "Set Migrations Project..." the project is created ok. But after this all the three menu items in the Migrations menu are greyed out - so this great feature is completely unusable for me in VS 2010 RC (premium). Can you take a look at this? |
|
|
Hello Nitra, We haven't been able to reproduce this I'm afraid. Is your migrations project in a solution folder? I think we currently have a bug with that scenario. If so, just remove the project from the folder and re-add it to the solution (you don't need to change the location on disk, just how it's presented in Solution Explorer). If your migrations project *isn't* in a solution folder, or if this doesn't fix it, could you provide us with: * The .lsmodel file and we'll take a look. Thanks! |
|
|
Thanks - your solution solved the problem. I can confirm that bug: I use solution folders to organize my projects. When I moved the migration project to the solution root the menu items were enabled. I just tested this and have not tested the functionality of the migration UI, hopefully it works correctly. |
|
|
Now I got the time to actually try using the migrations menu. When I try to"Create Migration..." I get the following error: Could not load file or assembly ... LightSpeed.Migrations, Version = 3.0.1053.12999 When I look in the Mindscape/LightSPeed/Migrations directory I see that the version of the assembly located there is older: 3.0.789.12667 I tried uninstalling and reinstalling both 3.0.1 and the VS2010 RC Alpha model GUI but I get the same error. Is it possible that the two MSI:s are out of sync? Can you update them and verify that they are in sync before publishing them? |
|
|
Hello Nitra, Sorry for the slow reply. Yes, the issue is that the MSIs are out of sync, because at the moment we have to build the VS2010 MSI by hand. Unfortunately, we probably won't be able to fix this reliably until we incorporate the VS2010 designer into our main build process, which won't happen until VS2010 RTMs. We'll see if we can do a rebuild/resync before then but I can't make any promises -- sorry about this! |
|
|
Thanks for your answer. If you could do a rebuild/resync before that I would be grateful as I am a bit stuck on this having to use VS 2010 with LightSpeed migrations. |
|
|
Hello Nitra, We now have a new build of the VS2010 designer posted in the store. The new build requires the 24 Mar 2010 nightly build of LightSpeed, which you can also get from the store. Please note: * the VS2010 designer will probably NOT work with subsequent nightlies, so if you download after about 1300 GMT then please double-check that you download the right nightly! * you will probably need to clean and rebuild your migrations project so that it picks up the right version of the migrations DLL. With the correct nightly build installed, we believe this fixes the migrations issue -- please let us know if you still see problems. |
|
|
The migrations GUI now works when using the new build! Nice! I run the migration programmatically when the tests/app starts and it almost works - the entities are created but my entity base class EntityBase that derives from Entity<int> is not migrated. So all columns are created for the entities except LockVersion, CreatedOn, UpdatedOn and DeletedOn that are defined in the base class. Have I missed something? Should the base class contain any attributes? I have tried both SQLite3 and SQL Server, same error. |
|
|
Is EntityBase defined in the designer or in code? The designer (and hence the migration creator) doesn't know about classes defined in code, so it won't generate anything for these; you'll need to manually add the required columns to the generated migration code. If EntityBase is defined in the designer then this is a bug -- let us know. |
|
|
I have defined EntityBase outside the designer so that the model UI is not all cluttered up with inheritance associations from every entity in the model to the base class. When I added the required columns to every table in the migration class it worked perfectly. Maybe you should look at a way of handling migrations with entity base classes defined outside the GUI? |
|
|
We would love to do this, but it is likely to be a substantial chunk of work -- the base class is likely to be part of the same project as the model so we can't use normal reflection techniques to access the fields, we would need to actually parse the C# or VB source code. VS does help with this but it is still not trivial, and it introduces all sorts of exciting new edge cases (e.g. what if the EntityBase class is syntactically invalid right now, for example because you have a dangling brace?). A more pragmatic solution might be for us to offer an option to hide inheritance associations to a common CTI base class. That would allow you to build the base class in the designer (where it will get picked up by migrations) without incurring all that clutter. I'll take a look at this but not sure when. |
|
|
The latter more pragmatic solution seems excellent to me, not only how it solves the migrations issue but also making it available in the model GUI. |
|