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-08 00:08:30 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-06-08 00:08:30 +0300
commite0d38e233de6113b51f784452d0f1f805356adaa (patch)
treee7e087fc5413c3b6176793a6f63f0b398640f99a /db
parent9ee2305f46a2b3d1d1e8a1f1182512599a74dbe1 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/fixtures/development/36_achievements.rb2
-rw-r--r--db/migrate/20230529173607_add_id_column_to_pm_checkpoints.rb21
-rw-r--r--db/schema_migrations/202305291736071
-rw-r--r--db/structure.sql18
4 files changed, 39 insertions, 3 deletions
diff --git a/db/fixtures/development/36_achievements.rb b/db/fixtures/development/36_achievements.rb
index 5798fd2d6c7..7a435daf82e 100644
--- a/db/fixtures/development/36_achievements.rb
+++ b/db/fixtures/development/36_achievements.rb
@@ -58,7 +58,7 @@ class Gitlab::Seeder::Achievements
end
Gitlab::Seeder.quiet do
- puts "\nGenerating ahievements"
+ puts "\nGenerating achievements"
group = Group.first
users = User.first(4).pluck(:id)
diff --git a/db/migrate/20230529173607_add_id_column_to_pm_checkpoints.rb b/db/migrate/20230529173607_add_id_column_to_pm_checkpoints.rb
new file mode 100644
index 00000000000..55135211ce8
--- /dev/null
+++ b/db/migrate/20230529173607_add_id_column_to_pm_checkpoints.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+class AddIdColumnToPmCheckpoints < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+
+ def up
+ add_column(:pm_checkpoints, :id, :bigserial)
+ add_index(:pm_checkpoints, :id, unique: true, name: :pm_checkpoints_unique_index) # rubocop:disable Migration/AddIndex
+ add_index(:pm_checkpoints, [:purl_type, :data_type, :version_format], unique: true, # rubocop:disable Migration/AddIndex
+ name: :pm_checkpoints_path_components)
+ swap_primary_key(:pm_checkpoints, :pm_checkpoints_pkey, :pm_checkpoints_unique_index)
+ end
+
+ def down
+ add_index(:pm_checkpoints, [:purl_type, :data_type, :version_format], unique: true, # rubocop:disable Migration/AddIndex
+ name: :pm_checkpoints_unique_index)
+ remove_index(:pm_checkpoints, name: :pm_checkpoints_path_components) # rubocop:disable Migration/RemoveIndex
+ unswap_primary_key(:pm_checkpoints, :pm_checkpoints_pkey, :pm_checkpoints_unique_index)
+ remove_column(:pm_checkpoints, :id)
+ end
+end
diff --git a/db/schema_migrations/20230529173607 b/db/schema_migrations/20230529173607
new file mode 100644
index 00000000000..f0f22512414
--- /dev/null
+++ b/db/schema_migrations/20230529173607
@@ -0,0 +1 @@
+5b2b9a7c58ed2153a70e4f32dbd8a4c4c9976afce478d761ced2ae9de43ea377 \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 23e2df53c91..d510a6ab9fb 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -20311,9 +20311,19 @@ CREATE TABLE pm_checkpoints (
purl_type smallint NOT NULL,
chunk smallint NOT NULL,
data_type smallint DEFAULT 1 NOT NULL,
- version_format smallint DEFAULT 1 NOT NULL
+ version_format smallint DEFAULT 1 NOT NULL,
+ id bigint NOT NULL
);
+CREATE SEQUENCE pm_checkpoints_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE pm_checkpoints_id_seq OWNED BY pm_checkpoints.id;
+
CREATE TABLE pm_licenses (
id bigint NOT NULL,
spdx_identifier text NOT NULL,
@@ -25668,6 +25678,8 @@ ALTER TABLE ONLY pm_advisories ALTER COLUMN id SET DEFAULT nextval('pm_advisorie
ALTER TABLE ONLY pm_affected_packages ALTER COLUMN id SET DEFAULT nextval('pm_affected_packages_id_seq'::regclass);
+ALTER TABLE ONLY pm_checkpoints ALTER COLUMN id SET DEFAULT nextval('pm_checkpoints_id_seq'::regclass);
+
ALTER TABLE ONLY pm_licenses ALTER COLUMN id SET DEFAULT nextval('pm_licenses_id_seq'::regclass);
ALTER TABLE ONLY pm_package_version_licenses ALTER COLUMN id SET DEFAULT nextval('pm_package_version_licenses_id_seq'::regclass);
@@ -27977,7 +27989,7 @@ ALTER TABLE ONLY pm_affected_packages
ADD CONSTRAINT pm_affected_packages_pkey PRIMARY KEY (id);
ALTER TABLE ONLY pm_checkpoints
- ADD CONSTRAINT pm_checkpoints_pkey PRIMARY KEY (purl_type, data_type, version_format);
+ ADD CONSTRAINT pm_checkpoints_pkey PRIMARY KEY (id);
ALTER TABLE ONLY pm_licenses
ADD CONSTRAINT pm_licenses_pkey PRIMARY KEY (id);
@@ -33506,6 +33518,8 @@ CREATE UNIQUE INDEX partial_index_sop_configs_on_project_id ON security_orchestr
CREATE INDEX partial_index_user_id_app_id_created_at_token_not_revoked ON oauth_access_tokens USING btree (resource_owner_id, application_id, created_at) WHERE (revoked_at IS NULL);
+CREATE UNIQUE INDEX pm_checkpoints_path_components ON pm_checkpoints USING btree (purl_type, data_type, version_format);
+
CREATE INDEX scan_finding_approval_mr_rule_index_id ON approval_merge_request_rules USING btree (id) WHERE (report_type = 4);
CREATE INDEX scan_finding_approval_mr_rule_index_merge_request_id ON approval_merge_request_rules USING btree (merge_request_id) WHERE (report_type = 4);