debian-mirror-gitlab/db/migrate/20190109153125_add_merge_request_external_diffs.rb

26 lines
1 KiB
Ruby
Raw Normal View History

2019-03-02 22:35:43 +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 AddMergeRequestExternalDiffs < ActiveRecord::Migration[5.0]
include Gitlab::Database::MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME = false
def change
# Allow the merge request diff to store details about an external file
2019-12-04 20:38:33 +05:30
add_column :merge_request_diffs, :external_diff, :string # rubocop:disable Migration/AddLimitToStringColumns
2019-03-02 22:35:43 +05:30
add_column :merge_request_diffs, :external_diff_store, :integer
add_column :merge_request_diffs, :stored_externally, :boolean
# The diff for each file is mapped to a range in the external file
add_column :merge_request_diff_files, :external_diff_offset, :integer
add_column :merge_request_diff_files, :external_diff_size, :integer
# If the diff is in object storage, it will be null in the database
change_column_null :merge_request_diff_files, :diff, true
end
end