<p>Hi all,</p>
<p>I was wondering if anyone had any recommendations (packages, etc) for managing DB migrations in a Go project. In particular, I'm looking for something that can handle incremental changes.</p>
<p>Thanks!</p>
<hr/>**评论:**<br/><br/>oarmstrong: <pre><p>I still just use Flyway personally. Its not written in Go, but who cares, its just a tool.</p></pre>vhodges: <pre><p>And I am using <a href="https://bitbucket.org/liamstask/goose/">https://bitbucket.org/liamstask/goose/</a> (it's kind of railsish in the way it works). I ended up adding support for running the migrations to my program to simplify deployment.</p></pre>devfuturesw: <pre><p>Gorm is a ORM library that can handle incremental migrations.
<a href="https://github.com/jinzhu/gorm">https://github.com/jinzhu/gorm</a>
<a href="https://github.com/jinzhu/gorm#migration">https://github.com/jinzhu/gorm#migration</a></p></pre>postman_: <pre><p>I used <a href="https://github.com/mattes/migrate">https://github.com/mattes/migrate</a> . I like its non-intrusiveness.</p></pre>nerdyworm: <pre><p>I've been using something akin to this: <a href="https://github.com/raintreeinc/knowledgebase/blob/master/kb/pgdb/version.go" rel="nofollow">https://github.com/raintreeinc/knowledgebase/blob/master/kb/pgdb/version.go</a> . Basically a versions table and a bunch of sql statements. This works fine for most of my small projects. I like shipping a single binary, so having the migrations be part of the source is a win for me.</p>
<p>For something a bit more robust then I can recommend <a href="https://bitbucket.org/liamstask/goose/" rel="nofollow">https://bitbucket.org/liamstask/goose/</a></p></pre>_thwarted: <pre><p>I'm using <a href="https://github.com/dwb/dogfish" rel="nofollow">https://github.com/dwb/dogfish</a> which isn't go specific, but does require bash, so it's not fully cross platform. Since it's external to the go code, it doesn't require building or running a binary in order to set up the database.</p></pre>br1and: <pre><p>I use a simple application that wraps <a href="https://github.com/DavidHuie/gomigrate" rel="nofollow">https://github.com/DavidHuie/gomigrate</a>. You can find it here: <a href="https://gist.github.com/bdittmer/573940d1e4d2842a68d1" rel="nofollow">https://gist.github.com/bdittmer/573940d1e4d2842a68d1</a></p></pre>kosokun: <pre><p>I use goose and I like it
<a href="https://bitbucket.org/liamstask/goose/" rel="nofollow">https://bitbucket.org/liamstask/goose/</a></p></pre>c-dex: <pre><p>+1 for Goose</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传