diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-14 18:13:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-14 18:13:45 +0300 |
commit | d7e72d98df261209772ce059e09381d36226913f (patch) | |
tree | a6f3ea3cd212d486de15d4e258585494589ee64e /db | |
parent | 89a0c1fa668ec9af6e7cc39935199f24dbee23b6 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/docs/xray_reports.yml | 12 | ||||
-rw-r--r-- | db/migrate/20231129211524_add_project_xray_report_model.rb | 19 | ||||
-rw-r--r-- | db/migrate/20231206144919_add_repository_xray_plan_limit.rb | 10 | ||||
-rw-r--r-- | db/schema_migrations/20231129211524 | 1 | ||||
-rw-r--r-- | db/schema_migrations/20231206144919 | 1 | ||||
-rw-r--r-- | db/structure.sql | 33 |
6 files changed, 75 insertions, 1 deletions
diff --git a/db/docs/xray_reports.yml b/db/docs/xray_reports.yml new file mode 100644 index 00000000000..5fa36d990f2 --- /dev/null +++ b/db/docs/xray_reports.yml @@ -0,0 +1,12 @@ +--- +table_name: xray_reports +classes: +- Projects::XrayReport +feature_categories: +- code_suggestions +description: The stored JSON output of repository X-Ray for a project +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/138220 +milestone: '16.7' +gitlab_schema: gitlab_main_cell +sharding_key: + project_id: projects diff --git a/db/migrate/20231129211524_add_project_xray_report_model.rb b/db/migrate/20231129211524_add_project_xray_report_model.rb new file mode 100644 index 00000000000..eed1ed2c6eb --- /dev/null +++ b/db/migrate/20231129211524_add_project_xray_report_model.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddProjectXrayReportModel < Gitlab::Database::Migration[2.2] + enable_lock_retries! + milestone '16.7' + + def change + create_table :xray_reports, if_not_exists: true do |t| + # we create an index manually below, don't create one here + t.references :project, null: false, index: false, foreign_key: { on_delete: :cascade } + t.timestamps_with_timezone null: false + t.text :lang, null: false, limit: 255 + t.jsonb :payload, null: false + t.binary :file_checksum, null: false + end + + add_index :xray_reports, [:project_id, :lang], unique: true, name: 'index_xray_reports_on_project_id_and_lang' + end +end diff --git a/db/migrate/20231206144919_add_repository_xray_plan_limit.rb b/db/migrate/20231206144919_add_repository_xray_plan_limit.rb new file mode 100644 index 00000000000..8d276aa9100 --- /dev/null +++ b/db/migrate/20231206144919_add_repository_xray_plan_limit.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class AddRepositoryXrayPlanLimit < Gitlab::Database::Migration[2.2] + enable_lock_retries! + milestone '16.7' + + def change + add_column :plan_limits, :ci_max_artifact_size_repository_xray, :bigint, default: 1.gigabyte, null: false + end +end diff --git a/db/schema_migrations/20231129211524 b/db/schema_migrations/20231129211524 new file mode 100644 index 00000000000..cbc92b47f14 --- /dev/null +++ b/db/schema_migrations/20231129211524 @@ -0,0 +1 @@ +0ee8b127bcdf66b2fe4639e8397d39052f61c16186b491039ce478f5b477a6a3
\ No newline at end of file diff --git a/db/schema_migrations/20231206144919 b/db/schema_migrations/20231206144919 new file mode 100644 index 00000000000..b99c72d6ad1 --- /dev/null +++ b/db/schema_migrations/20231206144919 @@ -0,0 +1 @@ +c5ccd76e1245234f4e78413d3afde72eb4c0c84ab723dffc6ac83abb619f43a9
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 484a667b113..03a9df13d29 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -21110,7 +21110,8 @@ CREATE TABLE plan_limits ( ci_job_annotations_size integer DEFAULT 81920 NOT NULL, ci_job_annotations_num integer DEFAULT 20 NOT NULL, file_size_limit_mb double precision DEFAULT 100.0 NOT NULL, - audit_events_amazon_s3_configurations integer DEFAULT 5 NOT NULL + audit_events_amazon_s3_configurations integer DEFAULT 5 NOT NULL, + ci_max_artifact_size_repository_xray bigint DEFAULT 1073741824 NOT NULL ); CREATE SEQUENCE plan_limits_id_seq @@ -25765,6 +25766,26 @@ CREATE SEQUENCE x509_issuers_id_seq ALTER SEQUENCE x509_issuers_id_seq OWNED BY x509_issuers.id; +CREATE TABLE xray_reports ( + id bigint NOT NULL, + project_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + lang text NOT NULL, + payload jsonb NOT NULL, + file_checksum bytea NOT NULL, + CONSTRAINT check_6da5a3b473 CHECK ((char_length(lang) <= 255)) +); + +CREATE SEQUENCE xray_reports_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE xray_reports_id_seq OWNED BY xray_reports.id; + CREATE TABLE zentao_tracker_data ( id bigint NOT NULL, integration_id bigint NOT NULL, @@ -27455,6 +27476,8 @@ ALTER TABLE ONLY x509_commit_signatures ALTER COLUMN id SET DEFAULT nextval('x50 ALTER TABLE ONLY x509_issuers ALTER COLUMN id SET DEFAULT nextval('x509_issuers_id_seq'::regclass); +ALTER TABLE ONLY xray_reports ALTER COLUMN id SET DEFAULT nextval('xray_reports_id_seq'::regclass); + ALTER TABLE ONLY zentao_tracker_data ALTER COLUMN id SET DEFAULT nextval('zentao_tracker_data_id_seq'::regclass); ALTER TABLE ONLY zoekt_indexed_namespaces ALTER COLUMN id SET DEFAULT nextval('zoekt_indexed_namespaces_id_seq'::regclass); @@ -30162,6 +30185,9 @@ ALTER TABLE ONLY x509_commit_signatures ALTER TABLE ONLY x509_issuers ADD CONSTRAINT x509_issuers_pkey PRIMARY KEY (id); +ALTER TABLE ONLY xray_reports + ADD CONSTRAINT xray_reports_pkey PRIMARY KEY (id); + ALTER TABLE ONLY zentao_tracker_data ADD CONSTRAINT zentao_tracker_data_pkey PRIMARY KEY (id); @@ -35271,6 +35297,8 @@ CREATE INDEX index_x509_commit_signatures_on_x509_certificate_id ON x509_commit_ CREATE INDEX index_x509_issuers_on_subject_key_identifier ON x509_issuers USING btree (subject_key_identifier); +CREATE UNIQUE INDEX index_xray_reports_on_project_id_and_lang ON xray_reports USING btree (project_id, lang); + CREATE INDEX index_zentao_tracker_data_on_integration_id ON zentao_tracker_data USING btree (integration_id); CREATE INDEX index_zoekt_indexed_namespaces_on_namespace_id ON zoekt_indexed_namespaces USING btree (namespace_id); @@ -38672,6 +38700,9 @@ ALTER TABLE ONLY reviews ALTER TABLE ONLY draft_notes ADD CONSTRAINT fk_rails_2a8dac9901 FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE CASCADE; +ALTER TABLE ONLY xray_reports + ADD CONSTRAINT fk_rails_2b13fbecf9 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY dependency_proxy_image_ttl_group_policies ADD CONSTRAINT fk_rails_2b1896d021 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; |