Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20230927141237_add_index_on_pages_deployments_deleted_at.rb')
-rw-r--r--db/migrate/20230927141237_add_index_on_pages_deployments_deleted_at.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/db/migrate/20230927141237_add_index_on_pages_deployments_deleted_at.rb b/db/migrate/20230927141237_add_index_on_pages_deployments_deleted_at.rb
new file mode 100644
index 00000000000..50857b03499
--- /dev/null
+++ b/db/migrate/20230927141237_add_index_on_pages_deployments_deleted_at.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class AddIndexOnPagesDeploymentsDeletedAt < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX = 'index_pages_deployments_on_deleted_at'
+
+ def up
+ add_concurrent_index :pages_deployments,
+ :deleted_at,
+ where: 'deleted_at IS NOT NULL',
+ name: INDEX
+ end
+
+ def down
+ remove_concurrent_index :pages_deployments, :deleted_at, name: INDEX
+ end
+end