Alex Rivera | Logout

Rails Migration: Bigint on PostgreSQL seems to be failing?

Asked 2011-08-15T02:40:04.020
22

Trying to create a table with a bigint column creates a standard integer column instead. What could be going wrong? I don't know where to start looking.

I'm using this in the migration:

create_table :table_name do |t|
  t.integer :really_big_int, limit: 8
end

I'm using Ruby 1.9.2, PostgreSQL 9.0.3 and Rails 3.0.9. I've dropped the database and ran the migrations several times and it still doesn't create the bigint column.

Edit
Report

1 Answer

29

For some reason the create table doesn't like bigint. You can, however do it with add_columm using the bigint data type:

add_column :table_name, :really_big_int, :bigint

Then you don't need that limit stuff.

answered 2012-05-23T00:32:38.907

Your Answer