== AddAncestryToMessages: migrating ==========================================
-- add_column(:messages, :ancestry, :string)
rake aborted!
An error has occurred, this and all later migrations canceled:
SQLite3::SQLException: no such table: messages: ALTER TABLE "messages" ADD "ancestry" varchar(255)
所以我的应用程序有你可以发布的消息(有点像 twitter),我正在添加回复,我正在使用祖先 gem 这样做。
我的schema.rb
文件中的代码(我认为这是每次运行 rake db:migrate 时用于创建表的文件。但我可能是错的(这可能是问题所在!)
create_table "messages", :force => true do |t|
t.string "content"
t.integer "user_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "ancestry"
end
add_index "messages", ["user_id", "created_at", "ancestry"], :name => "index_messages_on_user_id_and_created_at_and_ancestry"