diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-24 03:09:28 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-24 03:09:28 +0000 |
commit | be2f4c5788975597dd7be1c8a3525549770c1216 (patch) | |
tree | 083ed0d7e29e26d479c00e00d9cb89d74ebbb0ef /db/migrate | |
parent | 2711c26beaca6c3a5a3be4b65e01557faf0185b6 (diff) | |
download | gitlab-ce-be2f4c5788975597dd7be1c8a3525549770c1216.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20200318175008_add_index_on_id_and_archived_and_pending_delete_to_projects.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/db/migrate/20200318175008_add_index_on_id_and_archived_and_pending_delete_to_projects.rb b/db/migrate/20200318175008_add_index_on_id_and_archived_and_pending_delete_to_projects.rb new file mode 100644 index 00000000000..9dba8537764 --- /dev/null +++ b/db/migrate/20200318175008_add_index_on_id_and_archived_and_pending_delete_to_projects.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddIndexOnIdAndArchivedAndPendingDeleteToProjects < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + INDEX_NAME = 'index_projects_on_id_and_archived_and_pending_delete' + + disable_ddl_transaction! + + def up + add_concurrent_index :projects, :id, where: "archived = FALSE AND pending_delete = FALSE", name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :projects, INDEX_NAME + end +end |