From 411338f7a7aee58d58a5f6e743804c06f3cef6a8 Mon Sep 17 00:00:00 2001 From: Aurelien Poscia Date: Wed, 6 Sep 2023 15:40:04 +0200 Subject: SONAR-20392 Add github_perms_mapping table and unique index --- server/sonar-db-dao/src/schema/schema-sq.ddl | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'server/sonar-db-dao') diff --git a/server/sonar-db-dao/src/schema/schema-sq.ddl b/server/sonar-db-dao/src/schema/schema-sq.ddl index 8d0ad1275a1..94c89f05103 100644 --- a/server/sonar-db-dao/src/schema/schema-sq.ddl +++ b/server/sonar-db-dao/src/schema/schema-sq.ddl @@ -357,6 +357,14 @@ CREATE TABLE "GITHUB_ORGS_GROUPS"( ); ALTER TABLE "GITHUB_ORGS_GROUPS" ADD CONSTRAINT "PK_GITHUB_ORGS_GROUPS" PRIMARY KEY("GROUP_UUID"); +CREATE TABLE "GITHUB_PERMS_MAPPING"( + "UUID" CHARACTER VARYING(40) NOT NULL, + "GITHUB_ROLE" CHARACTER VARYING(100) NOT NULL, + "SONARQUBE_ROLE" CHARACTER VARYING(64) NOT NULL +); +ALTER TABLE "GITHUB_PERMS_MAPPING" ADD CONSTRAINT "PK_GITHUB_PERMS_MAPPING" PRIMARY KEY("UUID"); +CREATE UNIQUE NULLS DISTINCT INDEX "UNIQ_GITHUB_PERM_MAPPINGS" ON "GITHUB_PERMS_MAPPING"("GITHUB_ROLE" NULLS FIRST, "SONARQUBE_ROLE" NULLS FIRST); + CREATE TABLE "GROUP_ROLES"( "UUID" CHARACTER VARYING(40) NOT NULL, "ROLE" CHARACTER VARYING(64) NOT NULL, -- cgit v1.2.3