<hr/>**评论:**<br/><br/>mentalow: <pre><p>goose. afaik the only one that allows you to:
1) use it as a lib
2) do migrations from both .sql and .go files</p></pre>tty5: <pre><p>and I freakin hate it. I've been itching to write something less horrible and I might finally pull the trigger on that.</p></pre>mentalow: <pre><p>any constructive reason you hate it?</p></pre>tty5: <pre><ol>
<li>It requires a fully working golang env to run, which makes using it inside docker containers a pain - you have to make the images way larger than they'd otherwise be. Being able to compile migrations to a binary (which it does on run anyway) would be nice.</li>
<li>If you write a migration in go it's really hard to use anything but database/sql in it to access db. I really like my sqlx helpers and sometimes I'd even like to use the micro-not-really-orm we use</li>
<li>Environments have to be defined in a separate config file - I can't just use command line params, env variables etc. 12-factor app out of the window for migrations ;-)</li>
<li>Largely useless error reporting</li>
</ol>
<p>and despite all that it still is the best solution right now, which is unfortunate.</p></pre>daveddev: <pre><p>This has been useful for many projects I've worked on: <a href="https://github.com/rubenv/sql-migrate" rel="nofollow">https://github.com/rubenv/sql-migrate</a></p></pre>bkeroack: <pre><p><a href="https://github.com/mattes/migrate" rel="nofollow">https://github.com/mattes/migrate</a></p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传