I am developing a deployment system for a new web application, and I wonder where it is best to manage the database migration process (the question of how to perform the migration is another problem).
There seem to be two ways:
- Use a migration script that can either be run manually from a line command or as part of an automatic deployment / build process
- Start the migration when the application starts (I use ASP.NET so that it can be done quite easily without causing a long user request)
Does anyone have any suggestions / understanding / experience with these approaches? Any other suggestions?
I see why # 1 can be more attractive - it gives me full control over updating the database. However, I really like # 2, as it allows me to quickly iterate between deployments and reduce manual process. # 2 can also be used on my development machine to allow even faster iterations. Hmm, I'm starting to think that both can be good ...
roryf source
share