Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20230126023444_add_timestamps_to_package_metadata_tables.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ccf239ac273f1689310bd51d9fca49343f29b8dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

class AddTimestampsToPackageMetadataTables < Gitlab::Database::Migration[2.1]
  def up
    add_timestamps_with_timezone(:pm_packages, null: false, default: -> { 'NOW()' })
    add_timestamps_with_timezone(:pm_package_versions, null: false, default: -> { 'NOW()' })
    add_timestamps_with_timezone(:pm_licenses, null: false, default: -> { 'NOW()' })
    add_timestamps_with_timezone(:pm_package_version_licenses, null: false, default: -> { 'NOW()' })
  end

  def down
    remove_timestamps(:pm_packages)
    remove_timestamps(:pm_package_versions)
    remove_timestamps(:pm_licenses)
    remove_timestamps(:pm_package_version_licenses)
  end
end