« Back to blog

bigint and other column types in Rails Migrations

Apparently, storing facebook related id's require more than your
straight-out-of-the-box integer column type. Instead, I found that you
can specify just about any rdbms-specific column type in Rails
migrations by doing the following:

create_table [:sometable] do |t|
t.column [:column_name], "[column type]"
end

Take special note that the column type must be in quotation marks. In
the case of "bigint", after running the migration, I noticed it
converted it to an integer type with a specific limit.