diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-26 03:08:57 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-26 03:08:57 +0300 |
commit | b8fcf7c3d6c3b48e59e6aae5b1a6b536bba8ac40 (patch) | |
tree | 947b357adb3c1b51f2fb7ec761a7d9a35c260e28 /db | |
parent | 5edc7a04de12237658e7149385661aede45d681c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20230720142334_index_ml_model_versions_on_model_id_and_id.rb | 15 | ||||
-rw-r--r-- | db/migrate/20230725210728_drop_index_ml_model_versions_on_model_id.rb | 15 | ||||
-rw-r--r-- | db/schema_migrations/20230720142334 | 1 | ||||
-rw-r--r-- | db/schema_migrations/20230725210728 | 1 | ||||
-rw-r--r-- | db/structure.sql | 4 |
5 files changed, 34 insertions, 2 deletions
diff --git a/db/migrate/20230720142334_index_ml_model_versions_on_model_id_and_id.rb b/db/migrate/20230720142334_index_ml_model_versions_on_model_id_and_id.rb new file mode 100644 index 00000000000..934d5e1f8ee --- /dev/null +++ b/db/migrate/20230720142334_index_ml_model_versions_on_model_id_and_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class IndexMlModelVersionsOnModelIdAndId < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'unique_ml_model_versions_on_model_id_and_id' + + def up + add_concurrent_index :ml_model_versions, [:model_id, :id], name: INDEX_NAME, order: { id: :desc } + end + + def down + remove_concurrent_index_by_name :ml_model_versions, INDEX_NAME + end +end diff --git a/db/migrate/20230725210728_drop_index_ml_model_versions_on_model_id.rb b/db/migrate/20230725210728_drop_index_ml_model_versions_on_model_id.rb new file mode 100644 index 00000000000..9598e263488 --- /dev/null +++ b/db/migrate/20230725210728_drop_index_ml_model_versions_on_model_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class DropIndexMlModelVersionsOnModelId < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_ml_model_versions_on_model_id' + + def up + remove_concurrent_index_by_name :ml_model_versions, INDEX_NAME + end + + def down + add_concurrent_index :ml_model_versions, :model_id, name: INDEX_NAME + end +end diff --git a/db/schema_migrations/20230720142334 b/db/schema_migrations/20230720142334 new file mode 100644 index 00000000000..d9a15727ec2 --- /dev/null +++ b/db/schema_migrations/20230720142334 @@ -0,0 +1 @@ +f7f48a276a3ee396daa599d9f6f1d2478b0bbbdf79974ef4813070ba8fee9ef9
\ No newline at end of file diff --git a/db/schema_migrations/20230725210728 b/db/schema_migrations/20230725210728 new file mode 100644 index 00000000000..97decc29d68 --- /dev/null +++ b/db/schema_migrations/20230725210728 @@ -0,0 +1 @@ +4e79291e9c775309fe2e843887cc669e3146f19305aaaecf1252f1525ff5e032
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index f7b93fe07bf..d1f21674c21 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -32086,8 +32086,6 @@ CREATE UNIQUE INDEX index_ml_experiments_on_project_id_and_name ON ml_experiment CREATE INDEX index_ml_experiments_on_user_id ON ml_experiments USING btree (user_id); -CREATE INDEX index_ml_model_versions_on_model_id ON ml_model_versions USING btree (model_id); - CREATE INDEX index_ml_model_versions_on_package_id ON ml_model_versions USING btree (package_id); CREATE INDEX index_ml_model_versions_on_project_id ON ml_model_versions USING btree (project_id); @@ -33866,6 +33864,8 @@ CREATE UNIQUE INDEX unique_merge_request_diff_llm_summaries_on_mr_diff_id ON mer CREATE UNIQUE INDEX unique_merge_request_metrics_by_merge_request_id ON merge_request_metrics USING btree (merge_request_id); +CREATE INDEX unique_ml_model_versions_on_model_id_and_id ON ml_model_versions USING btree (model_id, id DESC); + CREATE UNIQUE INDEX unique_organizations_on_path ON organizations USING btree (path); CREATE UNIQUE INDEX unique_packages_project_id_and_name_and_version_when_debian ON packages_packages USING btree (project_id, name, version) WHERE ((package_type = 9) AND (status <> 4)); |