我是否正确地说 db/schema.rb 文件应该从 rake db:migrate 上的 db/migrate 文件中提取?我正在运行一个 rake db:migrate 并且它正在添加一个未在迁移中定义的表,也不是模型。有任何想法吗?
迁移文件(只有一个):
class CreateUsers < ActiveRecord::Migration
def change
create_table :users do |t|
t.string :email
t.string :hashed_password
t.timestamps
end
end
end
耙后的结果架构:
ActiveRecord::Schema.define(:version => 20121113214159) do
create_table "user_categories", :force => true do |t|
t.string "title"
t.string "description"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "users", :force => true do |t|
t.string "email"
t.string "hashed_password"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
end
我之前添加了一个 user_categories 脚手架,但不正确,所以我将其销毁。不知道我在破坏零件时哪里出错了......