New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
db/schema.rb turns mediumtext columns into longtext #3931
Comments
Hmm .. that decimal representation actually off a lot. I would expect it to be 5592405. Do you mind sending a pull request with a failing test case (and fix?) |
I think that I fixed it. The below definition is mysql side (strange...) behavior. Thus, I fixed Please see also http://dev.mysql.com/doc/refman/5.5/en/storage-requirements.html |
I realize mysql side behavior... If we use latin1 encoding, the limit is 16777215. |
Fix type_to_sql with text and limit on mysql/mysql2. Fix GH #3931 (Try again).
I'm closing this issue, because the above PR was merged. |
[3-2-stable] Fix type_to_sql with text and limit on mysql/mysql2. Fix GH #3931
[3-1-stable] Fix type_to_sql with text and limit on mysql/mysql2. Fix GH #3931
In Rails 3.1.1 the following migration line creates a column of MySQL type MEDIUMTEXT:
t.text :example, :limit => 0x555555 # this happens to be the maximum length for MEDIUMTEXT. 0x555556 results in LONGTEXT.
however the resulting line in db/schema.rb is
t.text "example", :limit => 16777215
which creates a column of type LONGTEXT.
I would expect that the database column types created by the migration files would be the same as those created by the db/schema.rb file.
The text was updated successfully, but these errors were encountered: