Create Instance Integrations table

What does this MR do and why?

This MR adds instance_integrations db table. It's needed because we need to split the existing integrations table that contains both cell-local (integrations with project_id/group_id association) and cluster wide (no association with group/project) integrations in order accommodate Cells infrastructure &14638

instance_integrations table schema slightly differs from integrations table. It has no:

  • project_id - since instance wide integrations have no project association
  • group_id - since instance wide integrations have no group association
  • instance - since it's always true
  • inherit_from_id - since instance wide integrations don't inherit settings
  • type_new STI column renamed to type

Mentions #474808 (closed)

Migration output
main: == 20240829163210 CreateInstanceIntegrationsTable: migrating ==================
main: -- execute("      CREATE TABLE instance_integrations (\n          id                                INTEGER DEFAULT nextval('integrations_id_seq'::regclass) NOT NULL PRIMARY KEY,\n          created_at                        timestamp with time zone NOT NULL,\n          updated_at                        timestamp with time zone NOT NULL,\n          active                            BOOLEAN DEFAULT FALSE NOT NULL,\n          push_events                       BOOLEAN DEFAULT TRUE,\n          issues_events                     BOOLEAN DEFAULT TRUE,\n          merge_requests_events             BOOLEAN DEFAULT TRUE,\n          tag_push_events                   BOOLEAN DEFAULT TRUE,\n          note_events                       BOOLEAN DEFAULT TRUE NOT NULL,\n          category                          VARCHAR,\n          wiki_page_events                  BOOLEAN DEFAULT TRUE,\n          pipeline_events                   BOOLEAN DEFAULT FALSE NOT NULL,\n          confidential_issues_events        BOOLEAN DEFAULT TRUE NOT NULL,\n          commit_events                     BOOLEAN DEFAULT TRUE NOT NULL,\n          job_events                        BOOLEAN DEFAULT FALSE NOT NULL,\n          confidential_note_events          BOOLEAN DEFAULT TRUE,\n          deployment_events                 BOOLEAN DEFAULT FALSE NOT NULL,\n          comment_on_event_enabled          BOOLEAN DEFAULT TRUE NOT NULL,\n          comment_detail                    SMALLINT,\n          alert_events                      BOOLEAN,\n          type                              TEXT,\n          vulnerability_events              BOOLEAN DEFAULT FALSE NOT NULL,\n          archive_trace_events              BOOLEAN DEFAULT FALSE NOT NULL,\n          encrypted_properties              BYTEA,\n          encrypted_properties_iv           BYTEA,\n          incident_events                   BOOLEAN DEFAULT FALSE NOT NULL,\n          group_mention_events              BOOLEAN DEFAULT FALSE NOT NULL,\n          group_confidential_mention_events BOOLEAN DEFAULT FALSE NOT NULL\n      );\n")
main:    -> 0.0034s
main: == 20240829163210 CreateInstanceIntegrationsTable: migrated (0.0191s) =========

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Edited by George Koltsov

Merge request reports

Loading