The core infrastructure backend (API, database, Docker, etc).
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

36 lines
1.7 KiB

START TRANSACTION;
CREATE TABLE "AccessPolicy" (
"Id" uuid NOT NULL,
"GroupId" uuid NULL,
"GrantedProjectId" uuid NULL,
"GrantedServiceAccountId" uuid NULL,
"ServiceAccountId" uuid NULL,
"OrganizationUserId" uuid NULL,
"Read" boolean NOT NULL,
"Write" boolean NOT NULL,
"CreationDate" timestamp without time zone NOT NULL,
"RevisionDate" timestamp without time zone NOT NULL,
"Discriminator" text NOT NULL,
CONSTRAINT "PK_AccessPolicy" PRIMARY KEY ("Id"),
CONSTRAINT "FK_AccessPolicy_Group_GroupId" FOREIGN KEY ("GroupId") REFERENCES "Group" ("Id"),
CONSTRAINT "FK_AccessPolicy_OrganizationUser_OrganizationUserId" FOREIGN KEY ("OrganizationUserId") REFERENCES "OrganizationUser" ("Id"),
CONSTRAINT "FK_AccessPolicy_Project_GrantedProjectId" FOREIGN KEY ("GrantedProjectId") REFERENCES "Project" ("Id"),
CONSTRAINT "FK_AccessPolicy_ServiceAccount_GrantedServiceAccountId" FOREIGN KEY ("GrantedServiceAccountId") REFERENCES "ServiceAccount" ("Id"),
CONSTRAINT "FK_AccessPolicy_ServiceAccount_ServiceAccountId" FOREIGN KEY ("ServiceAccountId") REFERENCES "ServiceAccount" ("Id")
);
CREATE INDEX "IX_AccessPolicy_GrantedProjectId" ON "AccessPolicy" ("GrantedProjectId");
CREATE INDEX "IX_AccessPolicy_GrantedServiceAccountId" ON "AccessPolicy" ("GrantedServiceAccountId");
CREATE INDEX "IX_AccessPolicy_GroupId" ON "AccessPolicy" ("GroupId");
CREATE INDEX "IX_AccessPolicy_OrganizationUserId" ON "AccessPolicy" ("OrganizationUserId");
CREATE INDEX "IX_AccessPolicy_ServiceAccountId" ON "AccessPolicy" ("ServiceAccountId");
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20221125155541_AccessPolicy', '6.0.4');
COMMIT;