使用symfony2和php在生产环境中使用doctrine2迁移是安全的 [英] Is it safe to use doctrine2 migrations in production environment with symfony2 and php

查看:99
本文介绍了使用symfony2和php在生产环境中使用doctrine2迁移是安全的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在建立一个复杂的应用程序,但我想知道在生产中使用原则迁移是安全的。

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

该网站已被使用1年,公司希望为用户表添加额外的属性。

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

所以我直接通过进入数据库或通过教义迁移p>

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

推荐答案

这是迁移的预期用途之一(和优点) - 自动更改您的数据库快速准确。 ,他们可以在大多数情况下应该用于在生产中更新数据库。

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.

编辑: Symfony2文档也清楚地解释这是迁移的目的之一。

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


当然,编写迁移的最终目标是能够在部署应用程序时,使用它们可靠地更新数据库结构。通过在本地(或在beta服务器上)运行迁移,您可以确保迁移按照您期望的方式工作。

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.

...

这篇关于使用symfony2和php在生产环境中使用doctrine2迁移是安全的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆