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, can you provide an example on how to use your Migration-feature the right way please? What I like to know is:
Thanks! |
|
|
No, the Migrations feature gives you a diff from your current model to the previous version of your model. It doesn't look at your databases at all. For example, suppose you create a new model, add an Order entity, and create a migration. Since there is no previous migration, that migration will include code for creating and dropping the Order table. Now suppose you add a Customer entity and an association, and create another migration. The designer compares your model to the previous migration, which only had an Order entity, and creates a migration with code for adding and dropping the Customer table and the Order.CustomerId foreign key. Notice that no databases are consulted, because you may not have created a database yet -- the only comparison is between snapshots of the model. When you do a migration, you get a C# or Visual Basic file containing code to upgrade the database schema from the previous version of model to the current version of the model (and to roll back that change). The code is in the form of a class that inherits from our Migration base class. You can freely edit this code for example to perform data migration, set up reference data, etc. The files representing all the Migration classes for a single model, from the very beginning to the very latest version, are compiled together into a DLL. You can then run the migrations in the following ways:
Does that clarify things? Please do ask if you need more info! |
|
|
Hi Ivan, thanks, a great explanation! Btw. how is the manual going? ;-) Thanks, Kay |
|
|
Uh, about as well as the screencast... * cough * There is a help file available for the designer -- unfortunately it's not very visible because we can't install it via the Extension Manager, but you can download it or read it online at http://www.mindscapehq.com/products/nhdesigner/documentation. It does include several pages on the migrations feature but we agree there is room for improvement! |
|