debian-mirror-gitlab/db/migrate/20190827222124_add_sourcegraph_configuration_to_application_settings.rb

24 lines
819 B
Ruby
Raw Normal View History

2019-12-26 22:10:19 +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 AddSourcegraphConfigurationToApplicationSettings < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME = false
2020-05-24 23:13:21 +05:30
# rubocop:disable Migration/PreventStrings
2019-12-26 22:10:19 +05:30
def up
add_column(:application_settings, :sourcegraph_enabled, :boolean, default: false, null: false)
add_column(:application_settings, :sourcegraph_url, :string, null: true, limit: 255)
end
2020-05-24 23:13:21 +05:30
# rubocop:enable Migration/PreventStrings
2019-12-26 22:10:19 +05:30
def down
remove_column(:application_settings, :sourcegraph_enabled)
remove_column(:application_settings, :sourcegraph_url)
end
end