小编ant*_*ony的帖子

Postgres警告:恢复时忽略错误:59

我正在使用Heroku推荐的pg:transfer实用程序来推送和提取数据库.例如:

heroku pg:transfer -f postgres://username:password@localhost/database-name -t postgres://user-name:password@host-name/database-name --confirm app-name
Run Code Online (Sandbox Code Playgroud)

我已经能够成功地完成它,但每次它都表明在传输结束时忽略了错误:

WARNING: errors ignored on restore: 59
Run Code Online (Sandbox Code Playgroud)

我需要担心吗?

编辑:

我经历了我的输出,似乎每张桌子都出错了.它似乎丢弃序列,然后抛出一个错误,说它不存在.

pg_restore: dropping SEQUENCE OWNED BY roles_id_seq 
pg_restore: dropping SEQUENCE roles_id_seq 
pg_restore: [archiver (db)] Error from TOC entry 170; 1259 35485 SEQUENCE roles_id_seq postgres 
pg_restore: [archiver (db)] could not execute query: ERROR: sequence "roles_id_seq" does not exist Command was: DROP SEQUENCE public.roles_id_seq;
Run Code Online (Sandbox Code Playgroud)

postgresql heroku pg

7
推荐指数
1
解决办法
9089
查看次数

使用Unicorn进行Heroku零停机部署

我想知道是否可以使用Heroku实现零停机时间部署策略.我发现目前的Heroku文档,在推送应用程序时,重新加载应用程序大约需要1分钟,这使得它无法使用.他们文档中的独角兽代码会预加载应用程序,所以我很困惑为什么会发生这种情况.我能在我身上做点什么吗?

https://devcenter.heroku.com/articles/rails-unicorn

我有新的遗物插件以及用于弹性搜索的盆景.

这是我的unicorn.rb初始化程序:

# config/unicorn.rb
worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3)
timeout 15
preload_app true

before_fork do |server, worker|

 Signal.trap 'TERM' do
   puts 'Unicorn master intercepting TERM and sending myself QUIT instead'
   Process.kill 'QUIT', Process.pid
 end

 defined?(ActiveRecord::Base) and
   ActiveRecord::Base.connection.disconnect!
end 

after_fork do |server, worker|

 Signal.trap 'TERM' do
   puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to send QUIT'
 end

 defined?(ActiveRecord::Base) and
   ActiveRecord::Base.establish_connection
end
Run Code Online (Sandbox Code Playgroud)

heroku unicorn

3
推荐指数
1
解决办法
2452
查看次数

Rails 4 Engine不迁移迁移

我创建了一个新的rails 4引擎并添加了一个模型.我正在尝试使用迁移数据库

RAILS_ENV=test rake db:migrate
Run Code Online (Sandbox Code Playgroud)

它回来时没有错误.但是,当我跑:

rspec spec
Run Code Online (Sandbox Code Playgroud)

返回错误表明存在挂起的迁移.

Migrations are pending; run 'rake db:migrate RAILS_ENV=test' to resolve this issue. (ActiveRecord::PendingMigrationError)
Run Code Online (Sandbox Code Playgroud)

如果我查看我的数据库(在pg和sqlite上试过)它们还没有被运行并且没有创建表,那也是如此.运行上面列出的建议命令不会运行迁移.

'engine_name/db/migrate'中只有一个迁移,虚拟应用内没有迁移.

我正在使用ruby 2.0和rails 4.0.0.rc1.

migration rails-engines ruby-on-rails-4

0
推荐指数
1
解决办法
2070
查看次数