diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-21 18:08:26 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-21 18:08:26 +0300 |
commit | c859c3bfd242288065fe5e2d887f7204f09e2335 (patch) | |
tree | 10febaf8774a3ea6ab3773c0dd97658d673fb280 /db/migrate/20200116175538_update_timestamp_softwarelicensespolicy.rb | |
parent | 28ce39a3e0e7b47e53939a15fb823af9c433327a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/migrate/20200116175538_update_timestamp_softwarelicensespolicy.rb')
-rw-r--r-- | db/migrate/20200116175538_update_timestamp_softwarelicensespolicy.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/db/migrate/20200116175538_update_timestamp_softwarelicensespolicy.rb b/db/migrate/20200116175538_update_timestamp_softwarelicensespolicy.rb new file mode 100644 index 00000000000..5ed797e33a3 --- /dev/null +++ b/db/migrate/20200116175538_update_timestamp_softwarelicensespolicy.rb @@ -0,0 +1,28 @@ +# 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 |