Datatypes (Mysql) in Rails Migrations

Hi

I’m using integer for most of my numeric data, and this is fine, but the
system I am building will convert my data structures OLTP to OLAP for
reporting. This will require TONS of data to be saved. In an effort to
reduce wasted space I’d rather use tinyint/smallint and other such more
precise data types in mysql.

Couldn’t find any documentation about these ‘nonstandard’ data types. In
addition I couldn’t find anything on use column options like “unsigned”.

Thanks.

On 6/10/07, Jean N. [email protected] wrote:

I’m using integer for most of my numeric data, and this is fine, but the
system I am building will convert my data structures OLTP to OLAP for
reporting. This will require TONS of data to be saved. In an effort to
reduce wasted space I’d rather use tinyint/smallint and other such more
precise data types in mysql.

Couldn’t find any documentation about these ‘nonstandard’ data types. In
addition I couldn’t find anything on use column options like “unsigned”.

Pass a string as the column type and it’ll be interpreted as a literal
sql fragment:
t.column :foo, ‘tinyint(2) unsigned’

Be sure not to use tinyint(1) since it’s used for booleans only.

jeremy

Jeremy K. wrote:

Pass a string as the column type and it’ll be interpreted as a literal
sql fragment:
t.column :foo, ‘tinyint(2) unsigned’

Be sure not to use tinyint(1) since it’s used for booleans only.

jeremy

Thanks! Where did you find out about this anyway?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs