2017-11-17 08:38:14 -05:00
|
|
|
# rubocop:disable Migration/UpdateLargeTable
|
2017-04-06 10:52:15 -04:00
|
|
|
# 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
|
|
|
|
|
2017-06-21 08:35:06 -04:00
|
|
|
disable_ddl_transaction!
|
|
|
|
|
2017-04-06 10:52:15 -04:00
|
|
|
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
|