Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails Migration: Bigint on PostgreSQL seems to be failing?

Tags:

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.

like image 657
Lonecat Avatar asked Aug 15 '11 02:08

Lonecat


1 Answers

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.

like image 140
Chris Barretto Avatar answered Oct 02 '22 19:10

Chris Barretto