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
|
sorry - I don't see where this is? I checked through the forum as best I could and didn't see any obvious mentions. I would like to generate a script directly from the model to apply to another database. I realise you can get all the increments as you go along - but I'd much rather have something I can send at the end (or if i just forgot to get the increments) thanks Ben |
|
|
You can use migrations to get a start-to-end script -- just select from the beginning to the end in the Run Migrations window. (Click on the earliest migration, then Ctrl+click on the latest.) (If your migrations project is currently set to run against a connected database, use the Change button to change it to generate SQL for a disconnected database instead.) The generated script will include all increments, so it will build up the database progressively rather than in one blast, but it will still be runnable as a single script. Alternatively, create a new, empty project and use Change Migration Project to set the migration project to this empty project. Then create a migration. That will effectively be a single increment that gets you to the final state: you can now use the Run Migrations window to generate SQL from that. Finally, a quick and dirty alternative is to create a blank database, change the model's connection string to point to that blank database, select the Update Database command and check the Log SQL box. This will deploy the model to the blank database, but as a side-effect, it will capture the DDL SQL, which you can then save and use as a deployment script for other databases. |
|
|
ok thanks Ivan, - I was already doing the blank database thing - I just thought I might have been missing the obvious. I'll give migrations a look cheers, Ben |
|