diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-29 21:10:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-29 21:10:36 +0300 |
commit | 1bbd0179d7ed8fb17c0574aa74ef491e53c833a7 (patch) | |
tree | c74a9b9d8f7ad1cedb0995e10340820467a8ab6f /db | |
parent | 4d3677a52dab1bb5c707ad493dcab8c8bca3dd8b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/docs/system_access_microsoft_applications.yml | 10 | ||||
-rw-r--r-- | db/docs/system_access_microsoft_graph_access_tokens.yml | 10 | ||||
-rw-r--r-- | db/migrate/20230616200440_create_system_access_microsoft_application.rb | 19 | ||||
-rw-r--r-- | db/migrate/20230616214220_create_system_access_microsoft_graph_access_tokens.rb | 15 | ||||
-rw-r--r-- | db/schema_migrations/20230616200440 | 1 | ||||
-rw-r--r-- | db/schema_migrations/20230616214220 | 1 | ||||
-rw-r--r-- | db/structure.sql | 66 |
7 files changed, 122 insertions, 0 deletions
diff --git a/db/docs/system_access_microsoft_applications.yml b/db/docs/system_access_microsoft_applications.yml new file mode 100644 index 00000000000..e168c9f41e4 --- /dev/null +++ b/db/docs/system_access_microsoft_applications.yml @@ -0,0 +1,10 @@ +--- +table_name: system_access_microsoft_applications +classes: + - SystemAccess::MicrosoftApplication +feature_categories: + - system_access +description: Integration with Microsoft Azure application +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/124101 +milestone: '16.2' +gitlab_schema: gitlab_main diff --git a/db/docs/system_access_microsoft_graph_access_tokens.yml b/db/docs/system_access_microsoft_graph_access_tokens.yml new file mode 100644 index 00000000000..a8a81a836ba --- /dev/null +++ b/db/docs/system_access_microsoft_graph_access_tokens.yml @@ -0,0 +1,10 @@ +--- +table_name: system_access_microsoft_graph_access_tokens +classes: + - SystemAccess::MicrosoftGraphAccessToken +feature_categories: + - system_access +description: Access tokens for the Microsoft Graph API +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/124101 +milestone: '16.2' +gitlab_schema: gitlab_main diff --git a/db/migrate/20230616200440_create_system_access_microsoft_application.rb b/db/migrate/20230616200440_create_system_access_microsoft_application.rb new file mode 100644 index 00000000000..d58dd8f88d9 --- /dev/null +++ b/db/migrate/20230616200440_create_system_access_microsoft_application.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class CreateSystemAccessMicrosoftApplication < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + create_table :system_access_microsoft_applications do |t| + t.timestamps_with_timezone null: false + t.references :namespace, index: { unique: true }, foreign_key: { on_delete: :cascade } + t.boolean :enabled, null: false, default: false + t.text :tenant_xid, null: false, limit: 255 + t.text :client_xid, null: false, limit: 255 + t.text :login_endpoint, null: false, limit: 255, default: 'https://login.microsoftonline.com' + t.text :graph_endpoint, null: false, limit: 255, default: 'https://graph.microsoft.com' + t.binary :encrypted_client_secret, null: false + t.binary :encrypted_client_secret_iv, null: false + end + end +end diff --git a/db/migrate/20230616214220_create_system_access_microsoft_graph_access_tokens.rb b/db/migrate/20230616214220_create_system_access_microsoft_graph_access_tokens.rb new file mode 100644 index 00000000000..df196280d0c --- /dev/null +++ b/db/migrate/20230616214220_create_system_access_microsoft_graph_access_tokens.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class CreateSystemAccessMicrosoftGraphAccessTokens < Gitlab::Database::Migration[2.1] + def change + create_table :system_access_microsoft_graph_access_tokens do |t| + t.timestamps_with_timezone null: false + t.references :system_access_microsoft_application, + index: { name: 'unique_index_sysaccess_ms_access_tokens_on_sysaccess_ms_app_id', unique: true }, + foreign_key: { on_delete: :cascade } + t.integer :expires_in, null: false + t.binary :encrypted_token, null: false + t.binary :encrypted_token_iv, null: false + end + end +end diff --git a/db/schema_migrations/20230616200440 b/db/schema_migrations/20230616200440 new file mode 100644 index 00000000000..b67a9da8a99 --- /dev/null +++ b/db/schema_migrations/20230616200440 @@ -0,0 +1 @@ +de2c254df58e13ffba7fef9bbf4fff2e244aa46ce58f8245646ed7ce4ab51770
\ No newline at end of file diff --git a/db/schema_migrations/20230616214220 b/db/schema_migrations/20230616214220 new file mode 100644 index 00000000000..7f006c6e985 --- /dev/null +++ b/db/schema_migrations/20230616214220 @@ -0,0 +1 @@ +29cf1dfb1429cb177f5b6cb2fae2a0bc388c0c6cbda5c4405456afcee8374a54
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 36736b727c0..24d6f53b0d9 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -23116,6 +23116,52 @@ CREATE SEQUENCE suggestions_id_seq ALTER SEQUENCE suggestions_id_seq OWNED BY suggestions.id; +CREATE TABLE system_access_microsoft_applications ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + namespace_id bigint, + enabled boolean DEFAULT false NOT NULL, + tenant_xid text NOT NULL, + client_xid text NOT NULL, + login_endpoint text DEFAULT 'https://login.microsoftonline.com'::text NOT NULL, + graph_endpoint text DEFAULT 'https://graph.microsoft.com'::text NOT NULL, + encrypted_client_secret bytea NOT NULL, + encrypted_client_secret_iv bytea NOT NULL, + CONSTRAINT check_042f6b21aa CHECK ((char_length(login_endpoint) <= 255)), + CONSTRAINT check_1e8b2d405f CHECK ((char_length(tenant_xid) <= 255)), + CONSTRAINT check_339c3ffca8 CHECK ((char_length(graph_endpoint) <= 255)), + CONSTRAINT check_ee72fb5459 CHECK ((char_length(client_xid) <= 255)) +); + +CREATE SEQUENCE system_access_microsoft_applications_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE system_access_microsoft_applications_id_seq OWNED BY system_access_microsoft_applications.id; + +CREATE TABLE system_access_microsoft_graph_access_tokens ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + system_access_microsoft_application_id bigint, + expires_in integer NOT NULL, + encrypted_token bytea NOT NULL, + encrypted_token_iv bytea NOT NULL +); + +CREATE SEQUENCE system_access_microsoft_graph_access_tokens_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE system_access_microsoft_graph_access_tokens_id_seq OWNED BY system_access_microsoft_graph_access_tokens.id; + CREATE TABLE system_note_metadata ( id integer NOT NULL, commit_count integer, @@ -25885,6 +25931,10 @@ ALTER TABLE ONLY subscriptions ALTER COLUMN id SET DEFAULT nextval('subscription ALTER TABLE ONLY suggestions ALTER COLUMN id SET DEFAULT nextval('suggestions_id_seq'::regclass); +ALTER TABLE ONLY system_access_microsoft_applications ALTER COLUMN id SET DEFAULT nextval('system_access_microsoft_applications_id_seq'::regclass); + +ALTER TABLE ONLY system_access_microsoft_graph_access_tokens ALTER COLUMN id SET DEFAULT nextval('system_access_microsoft_graph_access_tokens_id_seq'::regclass); + ALTER TABLE ONLY system_note_metadata ALTER COLUMN id SET DEFAULT nextval('system_note_metadata_id_seq'::regclass); ALTER TABLE ONLY taggings ALTER COLUMN id SET DEFAULT nextval('taggings_id_seq'::regclass); @@ -28379,6 +28429,12 @@ ALTER TABLE ONLY subscriptions ALTER TABLE ONLY suggestions ADD CONSTRAINT suggestions_pkey PRIMARY KEY (id); +ALTER TABLE ONLY system_access_microsoft_applications + ADD CONSTRAINT system_access_microsoft_applications_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY system_access_microsoft_graph_access_tokens + ADD CONSTRAINT system_access_microsoft_graph_access_tokens_pkey PRIMARY KEY (id); + ALTER TABLE ONLY system_note_metadata ADD CONSTRAINT system_note_metadata_pkey PRIMARY KEY (id); @@ -32950,6 +33006,8 @@ CREATE INDEX index_successful_deployments_on_cluster_id_and_environment_id ON de CREATE UNIQUE INDEX index_suggestions_on_note_id_and_relative_order ON suggestions USING btree (note_id, relative_order); +CREATE UNIQUE INDEX index_system_access_microsoft_applications_on_namespace_id ON system_access_microsoft_applications USING btree (namespace_id); + CREATE UNIQUE INDEX index_system_note_metadata_on_description_version_id ON system_note_metadata USING btree (description_version_id) WHERE (description_version_id IS NOT NULL); CREATE UNIQUE INDEX index_system_note_metadata_on_note_id ON system_note_metadata USING btree (note_id); @@ -33620,6 +33678,8 @@ CREATE UNIQUE INDEX unique_index_for_project_pages_unique_domain ON project_sett CREATE UNIQUE INDEX unique_index_on_system_note_metadata_id ON resource_link_events USING btree (system_note_metadata_id); +CREATE UNIQUE INDEX unique_index_sysaccess_ms_access_tokens_on_sysaccess_ms_app_id ON system_access_microsoft_graph_access_tokens USING btree (system_access_microsoft_application_id); + CREATE UNIQUE INDEX unique_instance_audit_event_destination_name ON audit_events_instance_external_audit_event_destinations USING btree (name); CREATE UNIQUE INDEX unique_merge_request_diff_llm_summaries_on_mr_diff_id ON merge_request_diff_llm_summaries USING btree (merge_request_diff_id); @@ -36917,6 +36977,9 @@ ALTER TABLE ONLY incident_management_oncall_participants ALTER TABLE ONLY work_item_parent_links ADD CONSTRAINT fk_rails_601d5bec3a FOREIGN KEY (work_item_id) REFERENCES issues(id) ON DELETE CASCADE; +ALTER TABLE ONLY system_access_microsoft_graph_access_tokens + ADD CONSTRAINT fk_rails_604908851f FOREIGN KEY (system_access_microsoft_application_id) REFERENCES system_access_microsoft_applications(id) ON DELETE CASCADE; + ALTER TABLE ONLY vulnerability_state_transitions ADD CONSTRAINT fk_rails_60e4899648 FOREIGN KEY (vulnerability_id) REFERENCES vulnerabilities(id) ON DELETE CASCADE; @@ -37607,6 +37670,9 @@ ALTER TABLE ONLY ci_job_artifacts ALTER TABLE ONLY organization_settings ADD CONSTRAINT fk_rails_c56e4690c0 FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE CASCADE; +ALTER TABLE ONLY system_access_microsoft_applications + ADD CONSTRAINT fk_rails_c5b7765d04 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY project_settings ADD CONSTRAINT fk_rails_c6df6e6328 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; |