保持数据库架构最新的技术
我知道有两种技术可以让所有开发人员保持数据库架构最新。
一是 Rails 迁移。另一个是Hibernate的SchemaUpdate。
您能否回顾更多使数据库模式保持最新的技术?
I know two techniques to keep database schema up to date for all developers.
One is rails migrations. And the other is Hibernate's SchemaUpdate.
Can you review more techniques to keep the DB schema up to date?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为很难找到一个现成的神奇工具来维护您的架构更改,我认为实现您的自定义工具并逐步设计更新并制作您自己的数据库版本控制系统并不难。
我的建议(我确实这样做)是制作一个小型更新程序工具,从新版本的应用程序中获取更新脚本,并根据保存在某处的先前数据库版本应用所需的更新,更新脚本应该是健壮的并且写得好,不会损坏旧数据。
因为 DDL 更改是不可逆的(不能使用事务),所以我建议在更新过程之前对数据库进行备份,并在更新失败时恢复它或将其删除。
I think its very hard to find a ready made, magical tool that maintain your schema changes, i think its not hard to implement your custom tool and design the updates incrementally and make your own versioning system of the database.
My suggestion (and i do that) is to make a small updater tool that take the update scripts from the new version of the application and apply the required updates depending on the previous DB version that is saved somewhere, the update scripts should be robust and well-written and don't make a damage for the old data.
Because DDL changes are not inversable (You can't use transactions) i suggest to take a backup for the database before the update process and restore it if the update failed or delete it.