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've added a new field to one of my Lightspeed objects in the model and I want to test a migrating this change to the local database but all of the menu option in the migrations menu are greyed out. What I want to do is populate the new field with valid, calculated values before running the application, will I be able to do this in a migration? |
|
|
You can, but you'll have to write code to do it -- LightSpeed will create only schema migrations for you. The simplest approach is to add calls to the ExecuteNativeCommand method, passing suitable INSERT or UPDATE SQL. Alternatively, you can use LightSpeed itself to create or update entities. Note that it's perfectly safe to add your own code to the generated migration code. (This is in contrast to the generated model code, which gets regenerated every time you edit the diagram.) The generated migration code is provided as a starting point, and we never overwrite it after it's been generated. Note also that editing your migrations to populate columns is orthogonal to the 'menu items greyed out' issue. We have a known bug where the menu items may all be greyed out if you have associated the model with a migration project, and then moved the migration project -- could this be the case? |
|
|
Yes, that is the case. I created a migration as a test and then deleted it. Is there some way to fix this? |
|
|
Open the .lsmodel file in Notepad, find the |
|