在Go语言中,可以使用”Golang-migrate”包来进行数据库迁移。

huangapple go评论87阅读模式
英文:

What package to use for database migrations in Go?

问题

我对golang还比较新,正在尝试找到最适合的工具。目前我正在评估以下几个包:

https://github.com/mattes/migrate

https://github.com/DavidHuie/gomigrate

https://bitbucket.org/liamstask/goose/

我想知道是否有人对这些包(或其他包)有过使用经验,并能提供一些评论。

英文:

I am fairly new to golang, and trying to identify the best tools for the job. Currently I am evaluating the following packages:

https://github.com/mattes/migrate

https://github.com/DavidHuie/gomigrate

https://bitbucket.org/liamstask/goose/

I was wondering if anyone had any experience with these (or other packages) and could provide some comments.

答案1

得分: 2

我们在工作中使用mattes/migrate,非常满意。它可以使用普通的SQL文件,自动处理文件命名,并且可以通过CLI轻松地进行自动化操作。它不涉及任何Go特定的内容。

而使用gomigrate,你需要自己创建文件,并编写代码来执行迁移操作。

英文:

We use mattes/migrate at work and are very happy with it. It works with plain SQL files, handles file naming by itself and can easily be automated via CLI. It doesn't do anything Go specific.

With gomigrate you need to create the files yourself and write code for executing the migrations.

答案2

得分: 2

请看 https://github.com/pressly/goose,这是 https://bitbucket.org/liamstask/goose/ 的一个维护分支。

英文:

Take a look at https://github.com/pressly/goose, a maintained fork of https://bitbucket.org/liamstask/goose/.

huangapple
  • 本文由 发表于 2015年11月10日 11:12:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/33622214.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定