Capistrano db:reset 不工作
Capistrano db:reset not working
我在 AWS 中有一个 rails 应用程序。我需要使用 Capistrano 运行 db:reset 并且我尝试了 2 个不同的 gems(capistrano-rails-db 和 capistrano-rails-collection),但它不起作用。我也尝试了我发现的 recipe 但它不起作用。迁移没有显示错误,但仍然没有迁移新的。
试试这个:
cap deploy:invoke task="db:reset"
示例用法:
cap staging deploy:invoke task=db:seed
cap deploy:invoke task=another:rake-task
或者这个:
bundle exec cap db:reset
namespace :db do
desc 'Resets DB without create/drop'
task :reset do
on primary :db do
within release_path do
with rails_env: fetch(:stage) do
execute :rake, 'db:schema:load'
execute :rake, 'db:seed'
end
end
end
end
end
您应该在各自的部署环境文件中编写命名空间代码
我在 AWS 中有一个 rails 应用程序。我需要使用 Capistrano 运行 db:reset 并且我尝试了 2 个不同的 gems(capistrano-rails-db 和 capistrano-rails-collection),但它不起作用。我也尝试了我发现的 recipe 但它不起作用。迁移没有显示错误,但仍然没有迁移新的。
试试这个:
cap deploy:invoke task="db:reset"
示例用法:
cap staging deploy:invoke task=db:seed
cap deploy:invoke task=another:rake-task
或者这个:
bundle exec cap db:reset
namespace :db do
desc 'Resets DB without create/drop'
task :reset do
on primary :db do
within release_path do
with rails_env: fetch(:stage) do
execute :rake, 'db:schema:load'
execute :rake, 'db:seed'
end
end
end
end
end
您应该在各自的部署环境文件中编写命名空间代码