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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HN: What tooling do you use for SQL/DB migrations

1 点作者 utahcon11 个月前
My team is growing and maturing, and we want to start keeping migrations and changes to the DB structure in a deployable manner. What tooling have you found that works best for this need?

2 条评论

gregjor11 个月前
We write the migrations in SQL, committed as part of the pull request. Migrations tested on copies of production database along with the code changes. Automatically applied by a script when a pull request gets merged&#x2F;deployed. No special tooling really, just a couple of SQL files.<p>We have a SQL preprocessor that lets us refer to environment globals and class constants in SQL, so we&#x27;re not hard-coding magic numbers and strings in the SQL. It resolves those with reflection on the code and replaces the named globals&#x2F;constants before sending the SQL to the database.
stop5011 个月前
since we use django, its own migration works best.