debian-mirror-gitlab/db/migrate/20220407135820_add_epics_relative_position.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
436 B
Ruby
Raw Normal View History

2022-06-21 17:19:12 +05:30
# frozen_string_literal: true
class AddEpicsRelativePosition < Gitlab::Database::Migration[1.0]
DOWNTIME = false
def up
return unless table_exists?(:epics)
return if column_exists?(:epics, :relative_position)
add_column :epics, :relative_position, :integer
execute('UPDATE epics SET relative_position=id*500')
end
def down
# no-op - this column should normally exist if epics table exists too
end
end