【发布时间】:2012-05-16 14:37:40
【问题描述】:
== 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"
【问题讨论】:
标签: ruby-on-rails migration dbmigrate ancestry