Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ruby sequel主键的bignum替代方案_Ruby_Sequel - Fatal编程技术网

ruby sequel主键的bignum替代方案

ruby sequel主键的bignum替代方案,ruby,sequel,Ruby,Sequel,从sequel 4.xx开始,此代码: Sequel.migration do up do create_table :rate do primary_key :id, :type => Bignum ... end end ... end 抛出错误 Sequel::错误:不支持的ruby类用作数据库类型:Bignum 那么,如果我想使用大整数创建PK,还有什么选择呢? 我使用ruby 2.2和postgresql 9.5。

从sequel 4.xx开始,此代码:

Sequel.migration do
  up do
    create_table :rate do
      primary_key :id, :type => Bignum
      ...    
      end  
  end
...
end
抛出错误
Sequel::错误:不支持的ruby类用作数据库类型:Bignum
那么,如果我想使用大整数创建PK,还有什么选择呢?

我使用ruby 2.2和postgresql 9.5。

使用
Bignum
(类)作为泛型类型被删除,因为它会在ruby 2.4中中断,因为在ruby 2.4中
Bignum
Integer
。使用
:Bignum
(符号)代替通用的64位整数类型。

让Sequel根据其对数据库的了解,确定主键使用什么。你在选择它时遇到过问题吗?还是你想比它聪明?