4 ms·
I STRONGLY advise you to keep your db changes tracked in version control along with your application changes. From .NET land, the guys who wrote DbUp are a goo
by daleholborow 9y ago
I STRONGLY advise you to keep your db changes tracked in version control along with your application changes.
From .NET land, the guys who wrote DbUp are a good example of a reasonably neat way of doing this. Check out their library.
I wrote a little tool for those of you who use ServiceStack, the approach is to spin up an application host that loads a list of db initialization and migration scripts to apply in sequence, scans your db for current version, and runs any scripts that have not yet been applied to your db.
This way, your db creation and migration is repeatable (I fire up all my test cases against a REAL db that i KNOW matches my production environment in structure), you can do various tricks to inject seed / test data along the way, you can get vastly greater comfort that your development and release will go smoother.
Its still unfortunately very light on readme documentation I just realised, but there is a test case which will demonstrate how a database can be created, and migrations, applied.
https://github.com/daleholborow/iayos.core.db.deploy/tree/master/src/iayos.core.db.deploy.Test https://github.com/daleholborow/iayos.core.db.deploy/tree/ma...