数据库网站的 GIT 相关问题
我正在加入一个现有项目,并被要求启用 GIT 修订控制。这是我第一次自己建立版本控制系统,并且在理解数据库如何适应项目的宏伟计划方面遇到了一些困难。
这是一个 Drupal 项目,并且已经在线托管。数据库服务器在线驻留,因此 Drupal 连接到该数据库。
我需要该数据库的本地副本吗?或者我应该继续将更改推送到服务器上现有的主数据库上。这是一个天真的问题,但我想确保这一点。
大多数情况下,我发现理解版本控制以及数据库如何适应这个难题有点困难。由于版本控制本质上是根据提交来推送和回滚更改,因此如果不允许提交或取消文件,数据库发生的更改是否会回滚?
有人愿意解释一下吗?
非常感谢!
I am joining an existing project and have been asked to enable GIT revision control. This is the first time I am setting up a version control system myself and am having slight difficulty in understanding how the database fits into the grand scheme of the project.
It's a Drupal project and has already been hosted online. The db server resides online and hence Drupal connects to this database.
Do I need a local copy of this database? Or I should go ahead and push changes on the main db existing on the server. This is a naive question, but I want to ensure this.
Mostly, I am finding it a little difficult to comprehend version control and how databases fit into the puzzle. Since version controls essentially push and rollback changes depending upon commits, do the changes that take place to a database rollback if a file isn't allowed to be committed or canceled?
Anyone willing to shed some light on this?
Thanks much!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你的问题不太清楚,但你应该查看版本控制sql脚本(而不是数据库本身 - 版本控制用于代码)并使用诸如 dbdeploy 等工具来管理数据库等像回滚等超出了版本控制工具的范围。
Your question is not really clear, but you should be looking at versioning sql scripts ( rather than the db themselves - version control is for code) and using some tool like
dbdeploy
etc to manage the db and such things like rollback etc are out of scope of versioning tools.数据库通常对版本控制不友好。标准做法是将代码置于版本控制中,并将数据库备份解决方案保持独立,通常是使用数据库引擎内置的备份工具。
Databases are not typically version-control friendly. Standard practice is to keep your code in version control and to keep the database backup solution separate, usually by using the backup tools built into the database engine.