db:Spree 中的迁移顺序

发布于 2024-07-30 07:16:32 字数 228 浏览 3 评论 0原文

我正在使用 spree 并创建了一个新的支付网关扩展。 问题是,我新创建的支付网关是在 spree 的核心支付网关之前先创建的。 这是错误消息。

不存在:显示gateway_options中的字段

I'm using spree and created a new payment gateway extension. The problem is, my newly created payment gateway gets created first before the core payment gateway of spree. Here's the error message.

doesn't exist: SHOW FIELDS FROM gateway_options

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

说好的呢 2024-08-06 07:16:32

我也遇到过同样的问题。 基本上,有一种方法可以定义扩展加载的顺序,但不能定义运行迁移时的顺序。

config.extensions = [:all, :site] 

更多信息此处

我的方法是简单地重命名稍后需要运行的扩展迁移的“db”文件夹。 当其他人运行后,我将其重命名回原来的名称并再次运行迁移。 很脏,但是有用。

可能有一种方法可以创建 rake 任务并使其自动化。

I've had the same problem. Basically, there's a way to define the order in which extensions are loaded but not when their migrations are ran.

config.extensions = [:all, :site] 

More info here.

The way I do it, is simply by renaming the "db" folder of the extensions' migrations needing to be ran later. When the others have ran, I rename it back to its original name and run the migrations again. Dirty, but it works.

There could probably be a way to make a rake task and automate this.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文