到目前为止,我非常欣赏将应用程序部署到heroku的简单方法。这是一次很棒的经历。但是,我反复得到一个错误,我找不到它的原因。 我正在研究最新的rails框架。我上传了所有内容,应用程序正在运行但是,当我收到以下错误时,我向表中添加了一些列并尝试执行rake db:migrate命令:
输入字符串长于NAMEDATALEN-1(63)
当我用Google搜索时,我发现,63是PostgreSQL中表名等的输入字符串的最大长度。但是,我检查了所有的表名,没有一个甚至接近它。您对迁移失败的原因有什么建议吗?
有问题的迁移如下:
class CreatePosts < ActiveRecord::Migration
def self.up
create_table :posts do |t|
t.text :data, :null => false
t.string :category, :null => false
t.string :zip, :limit => 5
t.boolean :published
t.integer :submittedby, :limit => 20
t.integer :reviewedby, :limit => 20
t.integer :likecount,
t.timestamps
end
end
def self.down
drop_table :posts
end
end
答案 0 :(得分:3)
错误是由:likecount
之后的逗号引起的。