Commit 9564caac authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch '323175-database-timeout-in-pages-migration-task' into 'master'

Add index on pages_deployment_id and deployed to metadata

See merge request gitlab-org/gitlab!55757
parents 03a90e30 e6d72ee7
---
title: Add index for pages migration
merge_request: 55757
author:
type: added
# frozen_string_literal: true
class AddDeployedDeploymentIdIndexToProjectPagesMetadata < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
INDEX_NAME = 'index_on_pages_metadata_not_migrated'
def up
add_concurrent_index :project_pages_metadata, :project_id, where: "deployed = TRUE AND pages_deployment_id is NULL", name: INDEX_NAME
end
def down
remove_concurrent_index_by_name :project_pages_metadata, INDEX_NAME
end
end
b2dad27276941e17248f86764196525bd91b088eed78ad7aa6ae2e5a2c9e82bd
\ No newline at end of file
......@@ -22909,6 +22909,8 @@ CREATE INDEX index_on_namespaces_lower_name ON namespaces USING btree (lower((na
CREATE INDEX index_on_namespaces_lower_path ON namespaces USING btree (lower((path)::text));
CREATE INDEX index_on_pages_metadata_not_migrated ON project_pages_metadata USING btree (project_id) WHERE ((deployed = true) AND (pages_deployment_id IS NULL));
CREATE INDEX index_on_projects_lower_path ON projects USING btree (lower((path)::text));
CREATE INDEX index_on_routes_lower_path ON routes USING btree (lower((path)::text));
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment