debian-mirror-gitlab/db/post_migrate/20170406142253_migrate_user_project_view.rb

23 lines
611 B
Ruby
Raw Normal View History

2018-03-17 18:26:18 +05:30
# rubocop:disable Migration/UpdateLargeTable
2017-08-17 22:00:37 +05:30
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
2018-12-23 12:14:25 +05:30
class MigrateUserProjectView < ActiveRecord::Migration[4.2]
2017-08-17 22:00:37 +05:30
include Gitlab::Database::MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME = false
2017-09-10 17:25:29 +05:30
disable_ddl_transaction!
2017-08-17 22:00:37 +05:30
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