Ruby on rails rspec测试期间出现超出范围错误,类型::Integer

Ruby on rails rspec测试期间出现超出范围错误,类型::Integer,ruby-on-rails,ruby,rspec,Ruby On Rails,Ruby,Rspec,获取失败的rspec测试,表明活动记录超出范围。不知道为什么会失败 这是错误 Failure/Error: Order.create! params.merge(user: user, subscription: subscription, product: product) ActiveModel::RangeError: 7554736346861994060 is out of range for ActiveModel::Type::Integer with limit 4 b

获取失败的rspec测试,表明活动记录超出范围。不知道为什么会失败

这是错误

Failure/Error: Order.create! params.merge(user: user, subscription: subscription, product: product)

 ActiveModel::RangeError:
   7554736346861994060 is out of range for ActiveModel::Type::Integer with limit 4 bytes
rspec试验

context 'subscription order params' do
      let(:subscription_order_params) { FactoryBot.attributes_for(:order,
                                                                  party_user_id: subscription_user.party_id,
                                                                  party_subscription_id: subscription.party_id,
                                                                  party_product_id: product.party_id)}

      it 'creates an order that belongs to a subscription customer' do
        post :create, params: { order: subscription_order_params }, as: :json

        expect(response.status).to eq 204
      end
    end

在4字节
INT
字段中,最多可以存储一个
2147483647
整数

7554736346861994060比2147483647大得多,因此需要超过4个字节

您需要一个不同的数据类型来支持这样的数字


添加一个迁移,将列更改为
biginger
,该列应存储大量数据。

请提供您的
顺序
架构