Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it safe to use doctrine2 migrations in production environment with symfony2 and php

I am building a complex application but i want to know that is it safe to use doctrine migrations in production.

For eg. the site has been used for 1 year and company wants to add extra attribute to user table.

So do i straight way chnage by going in database or through doctrine migrations

like image 594
Mirage Avatar asked Jul 10 '12 04:07

Mirage


1 Answers

This is one of the intended uses (and benefits) of migrations - to automate the changes to your database quickly and accurately. Yes, they can and in most cases should be used to update your database in production.

Edit: The Symfony2 documentation also explains clearly this is one of the purposes of migrations.

Of course, the end goal of writing migrations is to be able to use them to reliably update your database structure when you deploy your application. By running the migrations locally (or on a beta server), you can ensure that the migrations work as you expect.

...

like image 200
deefour Avatar answered Nov 06 '22 04:11

deefour