Answer the question
In order to leave comments, you need to log in
Rails doesn't work bigint?
Rails 5.2.3
old migration:
class CreateTmpUsers < ActiveRecord::Migration[5.2]
def change
create_table(:tmp_users) do |t|
t.integer :external_id
...
end
add_index ...
end
end
class MigrateToRails52 < ActiveRecord::Migration[5.2]
def up
change_column :tmp_users, :external_id, :bigint
...
end
create_table "tmp_users", force: :cascade do |t|
t.bigint "external_id"
...
end
create_table "tmp_users", force: :cascade do |t|
t.bigint "external_id"
...
end
message: 392169714724389808 is out of range for ActiveModel::Type::Integer with limit 4 bytes
error class: ActiveModel::RangeError
Answer the question
In order to leave comments, you need to log in
https://stackoverflow.com/a/3736425/1697148
Here's the magic incantation in your migration when you declare the column:
create_table :example do |t|
t.integer :field, :limit => 8
end
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question