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
|
We originally used to the Lightspeed modeller but now we are rewriting our API and the development is being done in Visual Studio 2015 (new API but the using the existing SQL Server 2012 database). So far, I haven't been able to get the Lightspeed model "new item template" to appear new item dialog. So, I used the lsgen.exe tool to generate my model classes from our existing database. It all worked as expected and CRUD operations are working. Now we would like to use migrations to manage our database. Is there a way to generate a migration to create the a database to the existing database's current state? I'm guessing there is a way to do it with the Lightspeed modeller. However, as previously mentioned, I can't get the modeller to work with Visual Studio 2015. Is there a way to create the initial migration from the command line? Moving forward, is there a way to auto-generate a migration? In Entity Framework code first, you create the model class and run a command line/package manager command to stub the migration. Is this workflow possible in Lightspeed? |
|
|
You will need to manage migrations using the Designer. If you are not seeing the LightSpeed Model template under the Data section for Create New Item you can try doing a refresh of Visual Studios caches as it may be the case where the template has for some reason not been picked up. This seems to have fixed some of the other issues we have seen. From an administrator command prompt, change directory to your Visual Studio 2015 install location, e.g. C:\Program Files (x86)\Microsoft Visual Studio 14.0, then cd Common7\IDE, then run devenv /setup There is a command line tool for applying migrations called lsmigrate which lives under the Migrations folder in your LightSpeed install directory. There is some basic documentation on this here: http://www.mindscapehq.com/documentation/lightspeed/Appendices/Command-Line-Tools-Reference
|
|
|
I figured out how to create migrations without the designer.
You have to figure out the upgrade and downgrade changes (I imagine that the designer would normally scaffold the changes for you). I have decided that the Lightspeed Designer is evil and and I prefer to everything code-first. Overall, Entity Framework is SO MUCH easier to use from a code first point of view. |
|