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
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-06-16 03:10:02 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-06-16 03:10:02 +0300
commite7da7e417c5f09cb673b1c9aca085b53b38bbe68 (patch)
tree66a55eae14dbf527a51fac25e8c82c07571e136a /db
parentbe522a9abd386ad605786eeb805e12025af0c742 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/post_migrate/20230612162643_pm_checkpoints_remove_advisory_entries.rb18
-rw-r--r--db/schema_migrations/202306121626431
2 files changed, 19 insertions, 0 deletions
diff --git a/db/post_migrate/20230612162643_pm_checkpoints_remove_advisory_entries.rb b/db/post_migrate/20230612162643_pm_checkpoints_remove_advisory_entries.rb
new file mode 100644
index 00000000000..370441730b6
--- /dev/null
+++ b/db/post_migrate/20230612162643_pm_checkpoints_remove_advisory_entries.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class PmCheckpointsRemoveAdvisoryEntries < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_pm
+
+ def up
+ execute("DELETE FROM pm_checkpoints
+ WHERE data_type = #{Enums::PackageMetadata::DATA_TYPES[:licenses]} and version_format = 1")
+ execute("UPDATE pm_checkpoints SET data_type = #{Enums::PackageMetadata::DATA_TYPES[:licenses]}
+ WHERE data_type = #{Enums::PackageMetadata::DATA_TYPES[:advisories]} and version_format = 1")
+ end
+
+ def down
+ # noop
+ end
+end
diff --git a/db/schema_migrations/20230612162643 b/db/schema_migrations/20230612162643
new file mode 100644
index 00000000000..f6591703cde
--- /dev/null
+++ b/db/schema_migrations/20230612162643
@@ -0,0 +1 @@
+3bddacf1e0535168b890b48528a92847a335db3e71dd70f2d5763488e65db0c9 \ No newline at end of file