diff options
author | Annabel Dunstone Gray <annabel.dunstone@gmail.com> | 2017-04-11 16:47:50 +0300 |
---|---|---|
committer | Annabel Dunstone Gray <annabel.dunstone@gmail.com> | 2017-04-11 16:47:50 +0300 |
commit | a9ff23407c9df7da171b4ad07d40ff8a3f4fac24 (patch) | |
tree | 77159a69db78601ded0d78573ff932eb3c141c1b /db | |
parent | 248c06a05cd7abb347e35c70ff573843ab15f329 (diff) | |
parent | e585b77730b2a38173453bb5e437628fe6eb9844 (diff) |
Merge branch 'dz-fix-project-view' into 'master'
Change project view default for existing users and anonymous visitors to files+readme
Closes #29926
See merge request !10498
Diffstat (limited to 'db')
-rw-r--r-- | db/post_migrate/20170406142253_migrate_user_project_view.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/db/post_migrate/20170406142253_migrate_user_project_view.rb b/db/post_migrate/20170406142253_migrate_user_project_view.rb new file mode 100644 index 00000000000..22f0f2ac200 --- /dev/null +++ b/db/post_migrate/20170406142253_migrate_user_project_view.rb @@ -0,0 +1,19 @@ +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class MigrateUserProjectView < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + # Set this constant to true if this migration requires downtime. + DOWNTIME = false + + def up + update_column_in_batches(:users, :project_view, 2) do |table, query| + query.where(table[:project_view].eq(0)) + end + end + + def down + # Nothing can be done to restore old values + end +end |