【发布时间】:2013-05-11 12:05:18
【问题描述】:
我有一个企业 Web 应用程序,由于各种原因,它与 SQL Server 以及 Mongoid 文档有 Active Record 连接。直到现在,人们一直反对更新到 Rails 3(是的,我知道,正好赶上 Rails 4)。该应用程序大部分运行良好,两个数据库相互配合。但是,我似乎失去了运行 SQL 数据库迁移的能力。
rake -T 给了我以下数据库选项:
rake db:drop # Drops all the collections for the database for the current Rails.env
rake db:mongoid:create_indexes # Create the indexes defined on your mongoid models
rake db:mongoid:drop # Drops the database for the current Rails.env
rake db:mongoid:purge # Drop all collections except the system collections
rake db:mongoid:remove_indexes # Remove the indexes defined on your mongoid models without questions!
rake db:purge # Drop all collections except the system collections
rake db:reseed # Delete data and seed
rake db:seed # Load the seed data from db/seeds.rb
rake db:setup # Create the database, and initialize with the seed data
rake db:migrate 只是返回,没有任何信息。
看起来 mongoid gem 可能是罪魁祸首,因为迁移适用于空白项目,并且唯一的 db 选项与 mongoid 相关。
我的问题是:升级到 rails 3 和 mongoid 3.1.3 后如何恢复 ActiveRecord 迁移?
【问题讨论】:
-
更新:我什至试过
rails g migration,新的迁移也没有被接受。
标签: sql ruby-on-rails-3 activerecord mongoid rake