diff options
author | Sean McGivern <sean@gitlab.com> | 2019-01-29 10:06:28 +0000 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2019-01-29 10:06:28 +0000 |
commit | 4a60baf9b1fe32cd6cd2effa16798ef4965f96dc (patch) | |
tree | 53b098a3ce46ab7387b2f6a062b532226324fd2d /db | |
parent | a2468878ddf27b568537cc6d8fb279294a55803f (diff) | |
parent | 49c74068ae7f0017ebeb8e7daa2c556fef3124e3 (diff) | |
download | gitlab-ce-4a60baf9b1fe32cd6cd2effa16798ef4965f96dc.tar.gz |
Merge branch '50352-sort-save' into 'master'
Save sorting preference for Issues/MRs in BE
Closes #50352
See merge request gitlab-org/gitlab-ce!24198
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20190116234221_add_sorting_fields_to_user_preference.rb | 21 | ||||
-rw-r--r-- | db/schema.rb | 2 |
2 files changed, 23 insertions, 0 deletions
diff --git a/db/migrate/20190116234221_add_sorting_fields_to_user_preference.rb b/db/migrate/20190116234221_add_sorting_fields_to_user_preference.rb new file mode 100644 index 00000000000..7bf581fe9b0 --- /dev/null +++ b/db/migrate/20190116234221_add_sorting_fields_to_user_preference.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class AddSortingFieldsToUserPreference < ActiveRecord::Migration[5.0] + include Gitlab::Database::MigrationHelpers + + # Set this constant to true if this migration requires downtime. + DOWNTIME = false + + def up + add_column :user_preferences, :issues_sort, :string + add_column :user_preferences, :merge_requests_sort, :string + end + + def down + remove_column :user_preferences, :issues_sort + remove_column :user_preferences, :merge_requests_sort + end +end diff --git a/db/schema.rb b/db/schema.rb index 859f007dbe1..7c1733becb9 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -2146,6 +2146,8 @@ ActiveRecord::Schema.define(version: 20190124200344) do t.integer "merge_request_notes_filter", limit: 2, default: 0, null: false t.datetime_with_timezone "created_at", null: false t.datetime_with_timezone "updated_at", null: false + t.string "issues_sort" + t.string "merge_requests_sort" t.index ["user_id"], name: "index_user_preferences_on_user_id", unique: true, using: :btree end |