mirror of
https://gitlab.com/gitlab-org/gitlab-foss.git
synced 2025-08-15 21:39:00 +00:00
21 lines
542 B
Ruby
21 lines
542 B
Ruby
# frozen_string_literal: true
|
|
|
|
class AddElasticsearchApplicationSettings < Gitlab::Database::Migration[2.2]
|
|
disable_ddl_transaction!
|
|
milestone '17.8'
|
|
|
|
def up
|
|
add_column :application_settings, :elasticsearch, :jsonb, default: {}, null: false, if_not_exists: true
|
|
|
|
add_check_constraint(
|
|
:application_settings,
|
|
"(jsonb_typeof(elasticsearch) = 'object')",
|
|
'check_application_settings_elasticsearch_is_hash'
|
|
)
|
|
end
|
|
|
|
def down
|
|
remove_column :application_settings, :elasticsearch, if_exists: true
|
|
end
|
|
end
|