summaryrefslogtreecommitdiff
path: root/db/migrate
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-07 12:09:13 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-07 12:09:13 +0000
commit211a8c3361ccf4eb92f36edbdcf15c98fcdcc8b7 (patch)
tree0ad37172721a39b0d57240bb1b4e70f200a0d93e /db/migrate
parent456a7247f9e88fc2518b69a1a00e905c6db6d775 (diff)
downloadgitlab-ce-211a8c3361ccf4eb92f36edbdcf15c98fcdcc8b7.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20200123040535_add_multi_column_index_on_lfs_objects_projects.rb17
-rw-r--r--db/migrate/20200123045415_remove_project_id_index_on_lfs_objects_projects.rb17
-rw-r--r--db/migrate/20200123092602_rename_services_template_to_instance.rb17
-rw-r--r--db/migrate/20200129234037_replace_conan_metadata_index.rb25
4 files changed, 76 insertions, 0 deletions
diff --git a/db/migrate/20200123040535_add_multi_column_index_on_lfs_objects_projects.rb b/db/migrate/20200123040535_add_multi_column_index_on_lfs_objects_projects.rb
new file mode 100644
index 00000000000..36ccfa4743e
--- /dev/null
+++ b/db/migrate/20200123040535_add_multi_column_index_on_lfs_objects_projects.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddMultiColumnIndexOnLfsObjectsProjects < ActiveRecord::Migration[5.2]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :lfs_objects_projects, [:project_id, :lfs_object_id]
+ end
+
+ def down
+ remove_concurrent_index :lfs_objects_projects, [:project_id, :lfs_object_id]
+ end
+end
diff --git a/db/migrate/20200123045415_remove_project_id_index_on_lfs_objects_projects.rb b/db/migrate/20200123045415_remove_project_id_index_on_lfs_objects_projects.rb
new file mode 100644
index 00000000000..540383e8808
--- /dev/null
+++ b/db/migrate/20200123045415_remove_project_id_index_on_lfs_objects_projects.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class RemoveProjectIdIndexOnLfsObjectsProjects < ActiveRecord::Migration[5.2]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ remove_concurrent_index :lfs_objects_projects, :project_id
+ end
+
+ def down
+ add_concurrent_index :lfs_objects_projects, :project_id
+ end
+end
diff --git a/db/migrate/20200123092602_rename_services_template_to_instance.rb b/db/migrate/20200123092602_rename_services_template_to_instance.rb
new file mode 100644
index 00000000000..42964dfe348
--- /dev/null
+++ b/db/migrate/20200123092602_rename_services_template_to_instance.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class RenameServicesTemplateToInstance < ActiveRecord::Migration[5.2]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ rename_column_concurrently :services, :template, :instance
+ end
+
+ def down
+ undo_rename_column_concurrently :services, :template, :instance
+ end
+end
diff --git a/db/migrate/20200129234037_replace_conan_metadata_index.rb b/db/migrate/20200129234037_replace_conan_metadata_index.rb
new file mode 100644
index 00000000000..4f55a2974d8
--- /dev/null
+++ b/db/migrate/20200129234037_replace_conan_metadata_index.rb
@@ -0,0 +1,25 @@
+# frozen_string_literal: true
+
+class ReplaceConanMetadataIndex < ActiveRecord::Migration[5.2]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+ OLD_INDEX = 'index_packages_conan_metadata_on_package_id'
+ NEW_INDEX = 'index_packages_conan_metadata_on_package_id_username_channel'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :packages_conan_metadata,
+ [:package_id, :package_username, :package_channel],
+ unique: true, name: NEW_INDEX
+
+ remove_concurrent_index_by_name :packages_conan_metadata, OLD_INDEX
+ end
+
+ def down
+ add_concurrent_index :packages_conan_metadata, :package_id, name: OLD_INDEX
+
+ remove_concurrent_index_by_name :packages_conan_metadata, NEW_INDEX
+ end
+end