多个项目使用的版本控制数据库
我目前正在开发一个包含多个“Visual Studio 解决方案”的项目。一个用于主应用程序,其他是基于组件的项目,将在其他应用程序中重用。
问题在于,所有三种解决方案都需要访问同一数据库中的数据。每个组件都有自己的一组视图、函数和存储过程,但架构在某些地方有所不同(一个组件可能需要另一个组件不需要的字段)。
基本上,我不想因为我在另一个解决方案中所做的更改而导致一个解决方案中断。
在我看来,我有两个选择:
- 创建一个在所有解决方案中引用的新项目,该项目纯粹包含数据库脚本
- 管理主应用程序解决方案中的架构以及其他解决方案中的视图、函数和存储过程(视情况而定)并当我进行构建时非常非常小心
任何建议将不胜感激。
预先感谢,
杰森
I'm currently working on a project that has several 'Visual Studio Solutions'. One is for the main application and the others are component-based projects which will be reused in other applications.
The problem is that all three solutions need to access data from the same database. Each component has its own set of views, functions and sprocs but the schema differs in places (one component may require a field that another component doesn't).
Basically, I don't want to have one solution break because of a change that I've made in another one.
The way I see it I have two options:
- Create a new project that is referenced in all solutions that purely contains database scripts
- Manage the Schema in the main application solution and the views, functions and sprocs in the other solutions (as appropriate) and be very, very careful when I do a build
Any suggestions would be greatly appreciated.
Thanks in advance,
Jason
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只是想我会在这里发布我的解决方案,以防万一其他人遇到同样的问题......
我最终选择了选项一。我创建了一个新的数据库项目,所有 3 个解决方案都引用了该项目。这不是世界上最漂亮的解决方案,但它确实有效。
再次感谢 Pranay 的回复。
Just thought I'd post my solution here just in case anyone else comes across the same problem...
I went with option one in the end. I created a new Database Project which is referenced in all 3 solutions. Not the prettiest solution in the world, but it works.
Thanks again to pranay for responding.