There is no such thing as tinyint(4)
in MySQL in the first place. tinyint
is a one byte signed integer. You can check all integer types in the docs. You may see something like tinyint(1)
even in the Rails source code, but I think it's a tautology as tinyint
already implies one byte storage.
The Rails way to declare TINYINT, SMALLINT, MEDIUMINT, INT, BIGINT
in a migration is by using limit:
with the appropriate byte size as can be seen in the source code.
Beware that Rails will treat one-byte integers as booleans by default though, as can be seen from the above link.