续集 - 一张桌子上的迁移失败

时间:2018-01-25 10:39:51

标签: ruby postgresql sequel

我正在尝试使用来自其他数据库的转储续集迁移进行初始迁移。但我仍然在一张桌子上遇到麻烦。

  

/ / / / / / / / / / / / / / / / / / / / / InFailedSqlTransaction:错误:当前事务中止,命令被忽略,直到事务块结束(Sequel :: DatabaseError)

在此表中。

create_table(:utilization_disks, :ignore_index_errors=>true) do
  primary_key :id, :type=>:Bignum
  String :ip, :size=>64, :null=>false
  String :device, :size=>16
  Integer :read_ops
  Integer :write_ops
  Integer :read_kbytes
  Integer :write_kbytes
  DateTime :tstamp

  check Sequel::SQL::BooleanExpression.new(:>=,Sequel::SQL::Identifier.new(:read_ops), 0)
  check Sequel::SQL::BooleanExpression.new(:>=, Sequel::SQL::Identifier.new(:write_ops), 0)
  check Sequel::SQL::BooleanExpression.new(:>=, Sequel::SQL::Identifier.new(:read_kbytes), 0)
  check Sequel::SQL::BooleanExpression.new(:>=, Sequel::SQL::Identifier.new(:write_kbytes), 0)

  index [:id], :name=>:id, :unique=>true
  index [:ip], :name=>:index_utilization_disks_ip
  index [:tstamp], :name=>:index_utilization_disks_tstamp
end

它是Postgresql适配器,无法找到问题。我可以随时重现错误。另外,我试图关闭多线程模式。

Sequel.single_threaded = true

可以肯定(此表是更大迁移的一部分),它不会在某处发生碰撞。

如果我迁移其余的数据库并尝试添加此表,它也会失败。其他表几乎相似。

感谢您的帮助

MP

0 个答案:

没有答案