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'm evaluating LightSpeed. I'd like to use database + LightSpeed ORM for storing data for CAE projects, as we're a company which produces CAE software. The main problem for me, is database structure upgrade. I assume that every project is stored in a separate database (either it is a mysql database on a remote server, or a SQLite file on the local computer). Over the time we make newer versions of our software and every version has slightly different database structure. I'd like to be able to open every "old" databases on the newest version. That's why I have to upgrade database structure. There are two solutions (AFAIK): 1. Upgrade the structure of the existing database before actually opening it. LightSpeed offers such function in the designer, however as far as I noticed it is limited to adding/removing fields (in my case it might be sufficient, I can't say the at the current stage). 2. Make an import of "old" database to the new database and then open a new database. Such import should ignore new fields and omit deleted fields. |
|
|
Have a look at this article: http://www.mindscape.co.nz/blog/index.php/2009/12/15/getting-started-with-lightspeed-migrations/ Although this is written in terms of applying migrations through the command line or GUI, it is also possible to host the migration functionality in your own program, so that your program can upgrade old database structures when it runs. You can add your own code to migrations, so that if you need to do stuff that the designer doesn't support (say, apply an index to a column, or convert values because you're changing the semantics of a column), you can still do it using native SQL or C#/VB. |
|
|
I wrote a blog post to get you started: http://www.mindscape.co.nz/blog/index.php/2010/12/01/upgrading-database-structures-with-lightspeed-migrations/ |
|
|
Thank you very much for the answer. I'll read the posts and check them out in my code. :-) |
|
|
I'm totally satisfied with the migration possibilities. :-) Thank you for your help. |
|