Refactor #13897
closedExplicitly set :limit on all DB migrations adding string columns
Description
Rails 4.2 changes the default options for string columns in DB migrations, removing the default limit of 255 characters for PostgreSQL and SQLite adapters (it remains for MySQL, since that's the limit of a VARCHAR).
http://edgeguides.rubyonrails.org/4_2_release_notes.html#active-record-notable-changes
All of our existing DB migrations should be changed to set :limit => 255
on add_column .. :string calls if no limit is already set. This will ensure that a database created on earlier versions will be exactly the same as one created on Rails 4.2.
I don't think we should change the limits of any columns while doing this, just be explicit about what limit they currently have. If we want to change limits, that should be done as an additional DB migration so the behaviour across versions is consistent.
Updated by Dominic Cleal almost 9 years ago
- Blocks Feature #13244: Upgrade Ruby on Rails to 4.2 added
Updated by Dominic Cleal almost 9 years ago
- Status changed from New to Assigned
- Assignee set to Dominic Cleal
Updated by The Foreman Bot almost 9 years ago
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/3261 added
Updated by Dominic Cleal almost 9 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 3339b4d8921e59e2b4d4b73eee5d234186b9d5b4.
Updated by David Davis almost 9 years ago
- Related to Refactor #14025: Specify string column limits added
Updated by Dominic Cleal almost 9 years ago
- Translation missing: en.field_release set to 136