Heroku“全球化3”迁移失败
我正在 Heroku 上部署 ruby on Rails 应用程序。在 localhost 上一切顺利,但是当运行
heroku rake db:migrate
在 heroku 上运行迁移时,我的迁移失败并出现以下错误:
耙子中止!发生错误, 这次以及所有后来的迁移 取消:
PGError:错误:当前事务 被中止,命令被忽略直到结束 交易块:CREATE TABLE “product_translations”(“id”序列号 主键,“product_id”整数, “区域设置”字符变化(255), “描述”文本,“创建时间” 时间戳,“updated_at”时间戳)
(通过运行任务查看完整跟踪 --跟踪)
我的迁移构建如下:
class CreateProducts < ActiveRecord::Migration
def self.up
create_table :products do |t|
t.string :image_path
t.text :description
t.timestamps
end
Product.create_translation_table! :description => :text
end
def self.down
drop_table :products
Product.drop_translation_table!
end
end
用于为 globalize3 创建表的查询(Product.create_translation_table!方法)似乎失败了。
有什么想法吗?
提前致谢
I'm deployinh a ruby on rails app on heroku. On localhost everything went well, but when running
heroku rake db:migrate
to run the migration on heroku my migration fails with this error:
rake aborted! An error has occurred,
this and all later migrations
canceled:PGError: ERROR: current transaction
is aborted, commands ignored until end
of transaction block : CREATE TABLE
"product_translations" ("id" serial
primary key, "product_id" integer,
"locale" character varying(255),
"description" text, "created_at"
timestamp, "updated_at" timestamp)(See full trace by running task with
--trace)
My migration is built as follows:
class CreateProducts < ActiveRecord::Migration
def self.up
create_table :products do |t|
t.string :image_path
t.text :description
t.timestamps
end
Product.create_translation_table! :description => :text
end
def self.down
drop_table :products
Product.drop_translation_table!
end
end
It seems the query used to create the table for globalize3 (the Product.create_translation_table! method) fails.
Any ideas?
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
他们说这是因为 gem 错误。
They are saying that it is because of a gem error.