简体   繁体   English

Heroku Rails mySql(mysql2 gem)迁移

[英]Heroku Rails mySql (mysql2 gem) migrations

Been able to make migrations (add columns etc) on my local machine with mysql. 能够使用mysql在我的本地计算机上进行迁移(添加列等)。

But when trying to push these migrations to Heroku, they continue to fail. 但是,当试图将这些迁移推向Heroku时,它们继续失败。

The first table in my migration file gets tagged with: 我的迁移文件中的第一个表被标记为:

 Mysql2::Error: Table 'xxxxx' already exists

locally all my migrations showing as: 在本地我所有的迁移显示为:

 up     20171127214206  Add tags to business

but when running heroku run rake db:migrate:status 但是在运行heroku时运行rake db:migrate:status

 down    20171127214206  Add tags to business

i don't mind losing all the data at this point as i'm working in a development version on Heroku and will merge later with production 我现在不介意丢失所有数据,因为我正在Heroku上进行开发,并且稍后将与生产合并

been working on this issue for over a day, so any and all advice appreciated. 在这个问题上进行了一天的努力,因此,所有建议都值得赞赏。

according to this and many other sources, it appears you're better to use postgresql adapter with heroku. 根据本文以及其他许多资料,似乎最好将postgresql适配器与heroku一起使用。 If you want to do that, you need to edit your database.yml similar to this 如果要执行此操作,则需要编辑类似于此的 database.yml

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM