How to create a column of type tinyint(2) or tinyint(3) in Ruby on Rails?

mysql, rails-migrations, ruby-on-rails, tinyint

Solution

For tinyint(2)

create_table :great_table do |t|
  t.integer :step_position, :limit => 2
end

For tinyint(3)

create_table :great_table do |t|
  t.integer :step_position, :limit => 3
end

Problem

In Ruby on Rails, the following code in a migration creates a column of type `tinyint(4)` in MySQL: ``` create_table :great_table do |t| t.integer :step_position, :limit => 1 #tinyint end ``` How would I create a column of type `tinyint(2)` or `tinyint(3)`?

Original source