我升级狂欢商务部从3.0版本到3.1版本,但忘记从我的本地开发环境上的Git迁移文件检查定影轨道迁移使用Capistrano的
我,而不是生成的迁移文件而不是在服务器上;我最终将从开发环境迁移到git,但现在我在部署时遇到了各种各样的问题,因为它试图在表存在时运行迁移。
我想我并不需要迁移,因为它在服务器上运行?
运行在服务器上显示rake db:migrate:status
:
up 20151015124064 Add meta title to page.spree static content
up 20151015124065 Add render as partial for layout for spree pages.spree static content
up 20151015124066 Add pages stores.spree static content
down 20160707102753 Create spree store credits.spree
down 20160707102754 Create spree store credit categories.spree
down 20160707102755 Create spree store credit events.spree
down 20160707102756 Create spree store credit types.spree
down 20160707102757 Add missing indexes.spree
down 20160707102758 Remove duplicated indexes from multi columns.spree
down 20160707102759 Remove user index from spree state changes.spree
down 20160707102760 Add position to spree payment methods.spree
down 20160707102761 Add taxable adjustment total to line item.spree
down 20160707102762 Migrate payment methods display.spree
down 20160707102763 Spree payment method store credits.spree
down 20160707102764 Rename has and belongs to associations to model names.spree
down 20160707102765 Spree store credit types.spree
down 20160707102766 Add discontinued to products and variants.spree
down 20160707102767 Remove shipping method id from spree orders.spree
down 20160707102768 Add id column to earlier habtm tables.spree
down 20160707102769 Add indexes.spree
down 20160707102770 Add missing indices on user.spree auth
down 20160707102771 Remove show in footer from spree pages.spree static content
在我的位置的机器它表明:
up 20151015124064 Add meta title to page.spree static content
up 20151015124065 Add render as partial for layout for spree pages.spree static content
up 20151015124066 Add pages stores.spree static content
up 20160707102753 Create spree store credits.spree
up 20160707102754 Create spree store credit categories.spree
up 20160707102755 Create spree store credit events.spree
up 20160707102756 Create spree store credit types.spree
up 20160707102757 Add missing indexes.spree
up 20160707102758 Remove duplicated indexes from multi columns.spree
up 20160707102759 Remove user index from spree state changes.spree
up 20160707102760 Add position to spree payment methods.spree
up 20160707102761 Add taxable adjustment total to line item.spree
up 20160707102762 Migrate payment methods display.spree
up 20160707102763 Spree payment method store credits.spree
up 20160707102764 Rename has and belongs to associations to model names.spree
up 20160707102765 Spree store credit types.spree
up 20160707102766 Add discontinued to products and variants.spree
up 20160707102767 Remove shipping method id from spree orders.spree
up 20160707102768 Add id column to earlier habtm tables.spree
up 20160707102769 Add indexes.spree
up 20160707102770 Add missing indices on user.spree auth
up 20160707102771 Remove show in footer from spree pages.spree static content
我相信在服务器上迁移状态应该是up
不down
。
是否有任何提示我应该如何处理?
感谢Vishal,我确实有数据,不幸的是,我尝试迁移:因为表已经存在,所以失败了。丢弃表格很好,但有不可逆转的迁移。 –
不可逆迁移是spree表或其他表的一部分,如果可能的话,您可以列出不可逆迁移文件。 –
并且由于迁移不成功,您可以添加2个方法** def up **和** def down **而不是** def change **在所有不可逆转的迁移中,因此您可以编写用于迁移和回滚的不同逻辑。我们可以通过转储SQL来保留数据。 –