I'm looking for a migrations framework that will work with an existing project that uses .NetTiers, an older ORM that requires CodeSmith to generate the data access code.
We have some experience of roundhouse, and we have had success in using it. We are also able to automatically deploy schema changes when running deployments out of Octopus Deploy. Fairly easy since it is just a collection of SQL scripts.
I have been interested in moving to FluentMigrator. I like the FM DSL and I found this SO question quite useful, however there are a couple of things I don't grok:
- What is the right way to import an existing database schema [*]?
- What is the right way to deploy migrations to a production environment [**]?
[*] My assumption is that I generate a single script using SQL Server tools and use ExecuteEmbeddedSql as the initial migration. Is that correct?
[**] There appears to be three main ways to run the migrations (Command Line, NAnt runner, MSBuild runner). They will need access to the database so they can run. Imagine we want to deploy this to a PROD environment. The developers and build server has no access to this environment. How do you run these runners against that environment?
Our usual deployment process is to produce a collection of SQL scripts that need to be deployed as part of the deployment. Ops run these as part of the deployment, either automatically as part of the Octopus Deploy process (powershell), or manually run if deployment is outside Octopus).
One complication that we have in this particular project is .NetTiers. This means that we have to run CodeSmith code generation using .NetTiers to build the data access layer before we can code against those entities and data services. Our workflow would therefore have to be:
- Write migration
- Run migration to upgrade database (target a specific .NetTiers database)
- Run .NetTiers against the specific .NetTiers database (central build server)
- Code against newly .NetTiers generated entities, db fields, etc
I'd love to dump .NetTiers, but a refactoring sadly isn't currently a viable option.
Embedded Resource
– Yates