Loading
Switch to Rails 5
What does this MR do?
- it switches default Rails version from 4 to 5
- it sets CI to run jobs both with Rails 4 and 5 (this is temporary)
Database changes
- Enables monkey patch
config/initializers/mysql_set_length_for_binary_indexes.rbalso for rails 4, the reason is that we want to run temporarily CI tests with rails4 even after switching to rails 5. Thins monkey patch fixest.indexfor Mysql - it sets default column length, ignores partial indexes if these are already defined, ignores idnexes which use opclasses - two specs are now triggered for rails 5 only (not for rails 4), because rails 4 allow to set only single index on the same column set (see https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/21492#note_113602758 for details). Because rails 4 in CI will be used only for a short time, there is no need to try to fix these tests for rails 4.
- it updates DB schema according to Rails 5 schema dump:
t.indexis now used instead ofadd_indext.bigintis now used instead oft.integer ... limit: 8user_statusesnow sets explicitlyintegersfor ID:
- create_table "user_statuses", primary_key: "user_id", force: :cascade do |t|
+ create_table "user_statuses", primary_key: "user_id", id: :integer, force: :cascade do |t|What are the relevant issue numbers?
Closes #48991 (closed)
Closes #14286 (closed)
Does this MR meet the acceptance criteria?
- Changelog entry added, if necessary
- Documentation created/updated
- Tests added for this feature/bug
- Conforms to the code review guidelines
- Conforms to the merge request performance guidelines
- Conforms to the style guides
- Conforms to the database guides
Edited by Jan Provaznik