debian-mirror-gitlab/db/migrate/20200116175538_update_timestamp_softwarelicensespolicy.rb

29 lines
705 B
Ruby
Raw Normal View History

2020-03-09 13:42:32 +05:30
# 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 UpdateTimestampSoftwarelicensespolicy < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
time = Time.zone.now
update_column_in_batches(:software_license_policies, :created_at, time) do |table, query|
query.where(table[:created_at].eq(nil))
end
update_column_in_batches(:software_license_policies, :updated_at, time) do |table, query|
query.where(table[:updated_at].eq(nil))
end
end
def down
# no-op
end
end