gpt4 book ai didi

ruby-on-rails - 无法获取 development_structure.sql

转载 作者:行者123 更新时间:2023-12-03 15:22:18 27 4
gpt4 key购买 nike

我正在使用 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

最佳答案

rake db:schema:dump 显式转储到 db/schema.rb

如果您执行 rake db:structure:dump,您将转储到 db/development_structure.sql

关于ruby-on-rails - 无法获取 development_structure.sql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3681335/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com