Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2019-11-09 00:06:35 +00:00
parent ae72d71da8
commit ab0f1c7a99
5 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,5 @@
---
title: Add migrations for 'soft-delete for groups' feature
merge_request: 19342
author:
type: added

View File

@ -0,0 +1,10 @@
# frozen_string_literal: true
class AddMarkForDeletionToNamespaces < ActiveRecord::Migration[5.2]
DOWNTIME = false
def change
add_column :namespaces, :marked_for_deletion_at, :date
add_column :namespaces, :marked_for_deletion_by_user_id, :integer
end
end

View File

@ -0,0 +1,20 @@
# frozen_string_literal: true
class AddMarkForDeletionIndicesToNamespaces < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_foreign_key :namespaces, :users, column: :marked_for_deletion_by_user_id, on_delete: :nullify
add_concurrent_index :namespaces, :marked_for_deletion_by_user_id, where: 'marked_for_deletion_by_user_id IS NOT NULL'
add_concurrent_index :namespaces, :marked_for_deletion_at, where: 'marked_for_deletion_at IS NOT NULL'
end
def down
remove_foreign_key_if_exists :namespaces, column: :marked_for_deletion_by_user_id
remove_concurrent_index :namespaces, :marked_for_deletion_by_user_id
remove_concurrent_index :namespaces, :marked_for_deletion_at
end
end

View File

@ -2492,11 +2492,15 @@ ActiveRecord::Schema.define(version: 2019_11_05_094625) do
t.boolean "emails_disabled"
t.integer "max_pages_size"
t.integer "max_artifacts_size"
t.date "marked_for_deletion_at"
t.integer "marked_for_deletion_by_user_id"
t.index ["created_at"], name: "index_namespaces_on_created_at"
t.index ["custom_project_templates_group_id", "type"], name: "index_namespaces_on_custom_project_templates_group_id_and_type", where: "(custom_project_templates_group_id IS NOT NULL)"
t.index ["file_template_project_id"], name: "index_namespaces_on_file_template_project_id"
t.index ["ldap_sync_last_successful_update_at"], name: "index_namespaces_on_ldap_sync_last_successful_update_at"
t.index ["ldap_sync_last_update_at"], name: "index_namespaces_on_ldap_sync_last_update_at"
t.index ["marked_for_deletion_at"], name: "index_namespaces_on_marked_for_deletion_at", where: "(marked_for_deletion_at IS NOT NULL)"
t.index ["marked_for_deletion_by_user_id"], name: "index_namespaces_on_marked_for_deletion_by_user_id", where: "(marked_for_deletion_by_user_id IS NOT NULL)"
t.index ["name", "parent_id"], name: "index_namespaces_on_name_and_parent_id", unique: true
t.index ["name"], name: "index_namespaces_on_name_trigram", opclass: :gin_trgm_ops, using: :gin
t.index ["owner_id"], name: "index_namespaces_on_owner_id"
@ -4363,6 +4367,7 @@ ActiveRecord::Schema.define(version: 2019_11_05_094625) do
add_foreign_key "namespaces", "namespaces", column: "custom_project_templates_group_id", name: "fk_e7a0b20a6b", on_delete: :nullify
add_foreign_key "namespaces", "plans", name: "fk_fdd12e5b80", on_delete: :nullify
add_foreign_key "namespaces", "projects", column: "file_template_project_id", name: "fk_319256d87a", on_delete: :nullify
add_foreign_key "namespaces", "users", column: "marked_for_deletion_by_user_id", name: "fk_9ff61b4c22", on_delete: :nullify
add_foreign_key "note_diff_files", "notes", column: "diff_note_id", on_delete: :cascade
add_foreign_key "notes", "projects", name: "fk_99e097b079", on_delete: :cascade
add_foreign_key "notes", "reviews", name: "fk_2e82291620", on_delete: :nullify

View File

@ -153,6 +153,8 @@ excluded_attributes:
namespaces:
- :runners_token
- :runners_token_encrypted
- :marked_for_deletion_at
- :marked_for_deletion_by_user_id
project_import_state:
- :last_error
- :jid