summaryrefslogtreecommitdiff
path: root/db/migrate/20200618134723_restore_previous_schema_with_lock_version_indices.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20200618134723_restore_previous_schema_with_lock_version_indices.rb')
-rw-r--r--db/migrate/20200618134723_restore_previous_schema_with_lock_version_indices.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/db/migrate/20200618134723_restore_previous_schema_with_lock_version_indices.rb b/db/migrate/20200618134723_restore_previous_schema_with_lock_version_indices.rb
new file mode 100644
index 00000000000..64fdb373387
--- /dev/null
+++ b/db/migrate/20200618134723_restore_previous_schema_with_lock_version_indices.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+class RestorePreviousSchemaWithLockVersionIndices < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :issues, :lock_version, where: "lock_version IS NULL"
+ add_concurrent_index :merge_requests, :lock_version, where: "lock_version IS NULL"
+ add_concurrent_index :epics, :lock_version, where: "lock_version IS NULL"
+ add_concurrent_index :ci_stages, :id, where: "lock_version IS NULL", name: "tmp_index_ci_stages_lock_version"
+ add_concurrent_index :ci_builds, :id, where: "lock_version IS NULL", name: "tmp_index_ci_builds_lock_version"
+ add_concurrent_index :ci_pipelines, :id, where: "lock_version IS NULL", name: "tmp_index_ci_pipelines_lock_version"
+ end
+
+ def down
+ # no-op
+ end
+end