asp.net mvc 3 - Using DropCreateDatabaseIfModelChanges in a production environment -


i've started learning .net mvc may silly question, i've yet find answer.

i'm following code first approach using entity framework build database me. i've included following in application_start() method in order allow me edit database making changes model objects.

database.setinitializer<contactmanagerdb>(new dropcreatedatabaseifmodelchanges<contactmanagerdb>()); 

i wondering happen if pushed application production environment , made few changes models , updated application? drop , recreate database in production environment?

what's best practice pushing changes production env. using code first approach?

dropcreatedatabaseifmodelchanges should use on in development, never on production machine. if pushed production machine , made schema changes, you'd loose data.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -