Database transfers: manage using build script or automatically when application starts?

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 ...

+3
source share
4 answers

~ 100, (, .) , , ( ​​ xyz?).

serveride # 1: SQL ( ) .

, IMHO:

  • : ,
  • : ,

, () RikMigrations. Google / : .NET Database Migration Tool Roundup. , .

+2

# 1 , . , , , , ( ?) , , .

+1

№1 . -, , , - timewaster. -, , (, , ).

, MSI , , .

, Wizardby.

0

- -, , - , (, - ).

, - , , .

0

Source: https://habr.com/ru/post/1706472/


All Articles