数据库中是否有用于版本控制的通用选项? [英] Are there generic options for version control within a database?

查看:72
本文介绍了数据库中是否有用于版本控制的通用选项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在开发项目中使用SVN的经验很少,而在关系数据库方面的经验也很少.我知道诸如表和SQL语句之类的基本概念,但我远非专家.

I have a small amount of experience using SVN on my development projects, and I have just as little experience with relational databases. I know the basic concepts like tables, and SQL statements, but I'm far from being an expert.

我想知道的是,是否有像SVN这样的通用版本控制类型的系统,但是它们适用于数据库而不是文件.我希望获得与SVN相同的功能,例如创建分支,创建标签以及将分支合并在一起的功能.与其将修订版本号与文件存储库的版本相关联,不如将其与数据库的版本相关联.

What I'd like to know is if there are any generic version control type systems like SVN, but that work with a database rather than files. I would like the same kind of features you get with SVN like the ability to create branches, create tags, and merge branches together. Rather than a revision number being associated to a version of a file repository it would be associated with a version of the database.

是否有任何通用解决方案可以独立于实际数据库模式添加这种功能?我会对与MySQL或MS SQL Server一起使用的解决方案感兴趣.

Are their any generic solutions available that can add this kind of functionality independent of the actual database schema? I'd be interested in solutions that work with MySQL or MS SQL Server.

我还应该澄清一下,我正在尝试对数据(而非架构)进行版本控制.我希望架构保持不变.如此看来,我似乎真的想要一种方法来创建在所有版本的数据之间发送数据库的所有INSERT,UPDATE和DELETE请求的日志.这样,可以通过重新发送已保存到所需版本的所有SQL语句来重新创建任何版本.

I should also clarify that I'm trying to version control the data not the schema. I would expect the schema to remain constant. So really it seems like I want a way to create a log of all the INSERT, UPDATE, and DELETE requests sent the the database between each version of the data. That way any version could be recreated by resending all the SQL statements that have been saved up to the desired version.

推荐答案

您可以将所有DDL,存储过程等脚本化为常规文本文件.

You can script all your DDL, stored procedures and such to regular text files.

然后,您可以简单地使用SVN进行数据库版本控制.

Then you can simply use SVN for database versioning.

这篇关于数据库中是否有用于版本控制的通用选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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