3 ms·
At my .NET shop we use FluentMigrator [1] which allows you to just run up/down migrations. Our deployments are completely automated and, in all honesty, while t
by sakopov 7y ago
At my .NET shop we use FluentMigrator [1] which allows you to just run up/down migrations. Our deployments are completely automated and, in all honesty, while this has been a great and a painless way to manage migrations there really is no silver bullet. Minor releases are dead simple. Larger releases require quite a bit of planning to make sure things are deployed in correct order and SQL updates are backwards-compatible (at least during the deployment window) so that we don't incur downtime or completely break things. The only time we ever had to roll back was when one of these large releases deployed a non-backwards-compatible SQL script which caused us a lot of bad data during 5 minute deployment window. So, this is usually a good motivating factor to try to deploy slim releases as frequently as possible. And if you do that you'll appreciate it when your DB migrations become boring and mundane things that just happen on auto-pilot.
[1] https://github.com/fluentmigrator/fluentmigrator https://github.com/fluentmigrator/fluentmigrator
- Merad 7y agoHow do you apply your migrations? I was setting up a project a few weeks ago and reached for FluentMigrator as it used to be my go to tool... but apparently the command line tool is now deprecated and they recommend writing custom code to do migrations. I eventually decided to give EF Core migrations a try, which is working pretty well so far.
- sakopov 7y agoWe use the CLI you're referring to on ci/cd servers. Frankly, I had no idea it was deprecated and couldn't find much on this after a little bit of googling. Would mind sharing a link?
- Merad 7y agoPerhaps "deprecated" isn't quite accurate. I could have sworn one of their documentation pages basically said, "there's a good chance you'll run into problems if you use the CLI, and we don't recommend using it." If there was something that explicit I can't find it at the moment. There is [0] that says "please use the in-process runner if possible," [1] discussing problems with the cli migrators, and [2] where the maintainer seems to have a preference for removing the cli's in the long run. [0]: https://fluentmigrator.github.io/articles/migration-runners.html?tabs=vs-pkg-manager-console https://fluentmigrator.github.io/articles/migration-runners.... [1]: https://github.com/fluentmigrator/fluentmigrator/issues/1006 https://github.com/fluentmigrator/fluentmigrator/issues/1006 [2]: https://github.com/fluentmigrator/fluentmigrator/issues/1016 https://github.com/fluentmigrator/fluentmigrator/issues/1016