How to seed the production database using the Capistrano gem?

后端 未结 6 2028
不思量自难忘°
不思量自难忘° 2021-01-30 01:47

I am using Ruby on Rails 3.0.9 and I would like to seed the production database in order to add some record without re-building all the database (that is, with

6条回答
  •  长发绾君心
    2021-01-30 02:17

    Try adding something like this in your deploy.rb:

    namespace :deploy do
      desc "reload the database with seed data"
      task :seed do
        run "cd #{current_path}; rake db:seed RAILS_ENV=#{rails_env}"
      end
    end
    

提交回复
热议问题