We have a database that persist our metadata and data.
我们有一个数据库可以保存我们的元数据和数据。
Our metadata is produced buy a dedicated team, using a Web application on the development server, and is a critical part of our application.
我们的元数据是使用开发服务器上的Web应用程序购买专用团队生成的,并且是我们应用程序的关键部分。
Then the customer generates data according to this metadata.
然后,客户根据此元数据生成数据。
We already version the database schema, and all schema change. The next step is to put our metadata under version control.
我们已经对数据库模式进行了版本控制,并且所下一步是将我们的元数据置于版本控制之下。
Naive solutionA naive solution would be to dump all the metadata, and commit it under version control before generating the corresponding packages. Since it's a dump, it can easily be restored. But there is probably a better way, like an incremental solution (only version diffs).
一个天真的解决方案是转储所有元数据,并在生成相应的包之前在版本控制下提交它。由于它是一个转储,它可以很容易地恢复。但是可能有更好的方法,比如增量解决方案(只有版本差异)。
Text dumpsAnother solution is to export all metadata tables in text format (like XML), and then version those text files. But then you have to find a way to reimport them.
另一种解决方案是以文本格式(如XML)导出所有元数据表,然后对这些文本文件进行版本控制。但是你必须找到一种方法来重新导入它们。
So, is your metadata under version control? Why? How?
那么,您的元数据是否受版本控制?为什么?怎么样?
3 个解决方案
#1
1
Non Niave solution:-
Non Niave解决方案: -
Version control your mata data build scripts.
版本控制您的mata数据构建脚本。
I.E. the database schema drop/create and the SQL "INSERTS" should both be placed under version control.
I.E.数据库模式drop / create和SQL“INSERTS”都应置于版本控制之下。
The advantage of this approach is thet the Schema and Insert scripts really are source code. Version controls systems are designed for source code so they play well with this method. In addition its pretty much self contained and can be easily ported to other systems.
这种方法的优点是Schema和Insert脚本确实是源代码。版本控制系统是为源代码设计的,因此它们可以很好地使用此方法。此外,它几乎是自包含的,可以很容易地移植到其他系统。
If your meta data is devleoped interactivley there are several utilities that will allow you to export your database as an insert script.
如果您的元数据是devleoped interactivley,则有几个实用程序可以将您的数据库导出为插入脚本。
#2
1
K. Scott Allen has a series of excellent blog posts about this subject:
K. Scott Allen有一系列关于这个主题的优秀博客文章:
- Versioning Databases - The Baseline
- Versioning Databases - Change Scripts
- Versioning Databases - Views, Stored Procedures, and the Like
- Versioning Databases - Branching and Merging
版本控制数据库 - 基线
版本控制数据库 - 更改脚本
版本控制数据库 - 视图,存储过程等
版本控制数据库 - 分支和合并
#3
1
Something to consider would be the tools available by Embarcadero. ErStudio for example provides the ability to version control against your entire database model.
需要考虑的是Embarcadero提供的工具。例如,ErStudio提供了针对整个数据库模型进行版本控制的功能。
#1
1
Non Niave solution:-
Non Niave解决方案: -
Version control your mata data build scripts.
版本控制您的mata数据构建脚本。
I.E. the database schema drop/create and the SQL "INSERTS" should both be placed under version control.
I.E.数据库模式drop / create和SQL“INSERTS”都应置于版本控制之下。
The advantage of this approach is thet the Schema and Insert scripts really are source code. Version controls systems are designed for source code so they play well with this method. In addition its pretty much self contained and can be easily ported to other systems.
这种方法的优点是Schema和Insert脚本确实是源代码。版本控制系统是为源代码设计的,因此它们可以很好地使用此方法。此外,它几乎是自包含的,可以很容易地移植到其他系统。
If your meta data is devleoped interactivley there are several utilities that will allow you to export your database as an insert script.
如果您的元数据是devleoped interactivley,则有几个实用程序可以将您的数据库导出为插入脚本。
#2
1
K. Scott Allen has a series of excellent blog posts about this subject:
K. Scott Allen有一系列关于这个主题的优秀博客文章:
- Versioning Databases - The Baseline
- Versioning Databases - Change Scripts
- Versioning Databases - Views, Stored Procedures, and the Like
- Versioning Databases - Branching and Merging
版本控制数据库 - 基线
版本控制数据库 - 更改脚本
版本控制数据库 - 视图,存储过程等
版本控制数据库 - 分支和合并
#3
1
Something to consider would be the tools available by Embarcadero. ErStudio for example provides the ability to version control against your entire database model.
需要考虑的是Embarcadero提供的工具。例如,ErStudio提供了针对整个数据库模型进行版本控制的功能。