TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: How do you manage your dev database among multiple developers?

8 点作者 shedd将近 15 年前
My co-founder posted this question on Stack Overflow (http://stackoverflow.com/questions/3133639/how-do-you-manage-databases-during-development) and got some good advice. I wanted to get the HN community's take on the question and see if there were any other thoughts:<p>In your agile startup, how do you handle a multi-person development team where each developer is making changes to the DB schema and everyone needs to have a current copy for local development and testing? What SCM strategies do you use and/or what software to replicate the database? Do you have a central development database?<p>Thanks for the thoughts!

5 条评论

kls将近 15 年前
Database replication will always fail. What you need to do is treat database changes no different that software changes. Developers should make modifications to there local database (they are running local right) and then as they complete their work. The need to script the DDL and DML. This way, the changes can be versioned and applied in sequence to existing environments as well as new environments. The root of all change in a system should always be versioning, to try to manage it any other way is inviting trouble.
maxdemarzi将近 15 年前
My employer uses .NET, but we use the "Rails" model for databases. We have population and migration script directories (for each database) which each contain numbered .sql files. Everything in SVN, update to latest, make your changes, make a migration script, commit script. Repeat.
shedd将近 15 年前
Clickable link to Stack Overflow question &#38; thoughts:<p><a href="http://stackoverflow.com/questions/3133639/how-do-you-manage-databases-during-development" rel="nofollow">http://stackoverflow.com/questions/3133639/how-do-you-manage...</a><p>plus the other similar thread on Stack Overflow:<p><a href="http://stackoverflow.com/questions/988426/how-should-you-build-your-database-from-source-control" rel="nofollow">http://stackoverflow.com/questions/988426/how-should-you-bui...</a>
评论 #1469596 未加载
vandahm将近 15 年前
Liquibase:<p><a href="http://www.liquibase.org/" rel="nofollow">http://www.liquibase.org/</a><p>The contents of our personal development databases are not synchronized, just the schema. Each developer has enough mock data to run our app for development purposes.<p>At a previous job, all developers shared a single development database. It was a huge pain, and I don't recommend that practice.
评论 #1470435 未加载
darklighter3将近 15 年前
One option is to have your code manage the database schema it needs rather than managing the schema externally. You would have some kind of initialization routine that checks the schema and creates anything that it needs. This probably makes a little more sense if you are using some kind of OR mapping scheme so you don't have to duplicate data (some OR mapping tools can do this for you).