开发者

DB:migrate fails on Heroku due NAMEDATALEN

I really appreciate the easiness of deploying apps to heroku so far. It has been a great experience. However, I repeatedly get an error, and I cannot find the cause for it. I work on the latest rails framework. I uploaded everything and the app is running. However, I added some columns to my tables and tried to do the rake db:migrate command, when I get the following error:

Input string is longer than NAMEDATALEN-1 (63)

When I googled it, I found out, that 63 is the maximum length of an input string 开发者_如何学JAVAfor a table name etc. in PostgreSQL. However, I checked all my table names, and none comes even close to it. Do you have any suggestions why the migration fails?

The migration in question is as following:

    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


The error was caused by the comma after :likecount.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜