我正在使用rails 2.3.9,我希望以sql方式进行数据库转储。这是我的environment.rb。注意我有的最后一行
config.active_record.schema_format = :sql
当我运行rake db:schema:dump时,我看不到db / development_structure.sql文件。
require File.join(File.dirname(__FILE__), 'boot')
RAILS_GEM_VERSION = '2.3.9' unless defined? RAILS_GEM_VERSION
Rails::Initializer.run do |config|
config.frameworks -= [:active_resource]
config.gem 'hoptoad_notifier', :version => '>= 2.3.6'
config.gem "will_paginate", :version => ">= 2.3.2"
config.gem "sanitize"
config.action_mailer.delivery_method = :smtp
if RAILS_ENV == 'development' || RAILS_ENV == 'test'
config.action_mailer.delivery_method = :test
config.gem "shoulda", :version => '2.10.2'
config.gem 'faker', :version=>'~>0.3'
config.gem "factory_girl", :version => ">= 1.2.4"
config.gem "coderay"
config.gem "redgreen"
end
# Your secret key for verifying cookie session data integrity.
# If you change this key, all old sessions will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
config.action_controller.session = {
:session_key => '_delako_session_v2',
:secret => 'd9035d20745f5e3fbe1604a393e59cb4f5e59fd7188cbabe0a5245d84e383cf567f90c3849f2d605d5b05669772b60150f2acb4cfddc897b7361fbfe586bb5c6'
}
config.active_record.schema_format = :sql
end
答案 0 :(得分:6)
rake db:schema:dump
显式转储到db/schema.rb
。
如果您执行rake db:structure:dump
,则会转储到db/development_structure.sql
。