Commit e6d72ee7 authored by Vladimir Shushlin's avatar Vladimir Shushlin Committed by Kamil Trzciński

Add index on pages_deployment_id and deployed to metadata

it will be used by the pages migration in
only_on_legacy_storage scope
parent 522fb0d3
---
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
...@@ -22881,6 +22881,8 @@ CREATE INDEX index_on_namespaces_lower_name ON namespaces USING btree (lower((na ...@@ -22881,6 +22881,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_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_projects_lower_path ON projects USING btree (lower((path)::text));
CREATE INDEX index_on_routes_lower_path ON routes 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