ALTER TABLE [SiteRepositoryWebSite]
ADD [SharePointWebId] UNIQUEIDENTIFIER

CREATE TABLE [dbo].[SiteRepositoryConfigRoles] (
    [Id]                      INT            IDENTITY (1, 1) NOT NULL,
    [PermissionMask]          BIGINT         NOT NULL,
    [Name]                    NVARCHAR (MAX) NOT NULL,
    [SiteRepositoryConfig_Id] NVARCHAR (50)  NOT NULL,
    CONSTRAINT [PK_SiteRepositoryConfigRoles] PRIMARY KEY CLUSTERED ([Id] ASC),
    CONSTRAINT [FK_SiteRepositoryConfigSiteRepositoryConfigRole] FOREIGN KEY ([SiteRepositoryConfig_Id]) REFERENCES [dbo].[SiteRepositoryConfig] ([Id])
)

CREATE TABLE [dbo].[SiteRepositoryRoleAssignments] (
    [Id]                          INT IDENTITY (1, 1) NOT NULL,
    [RoleDefinitionId]            INT NOT NULL,
    [SiteRepository_Id]           INT NOT NULL,
    [SiteRepositoryConfigRole_Id] INT NOT NULL,
    CONSTRAINT [PK_SiteRepositoryRoleAssignments] PRIMARY KEY CLUSTERED ([Id] ASC),
    CONSTRAINT [FK_SiteRepositoryConfigRoleSiteRepositoryRoleAssignment] FOREIGN KEY ([SiteRepositoryConfigRole_Id]) REFERENCES [dbo].[SiteRepositoryConfigRoles] ([Id]),
    CONSTRAINT [FK_SiteRepositorySiteRepositoryRoleAssignment] FOREIGN KEY ([SiteRepository_Id]) REFERENCES [dbo].[SiteRepository] ([Id])
)