This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param | |
( | |
[string]$PAT, | |
[string]$UserGitHub, | |
[string]$Connstr | |
) | |
Get-Date | |
$SQLQuery="TRUNCATE TABLE RepositoriesStargazers" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE [dbo].[RepositoriesForks]( | |
RepositoryName [varchar](100) NOT NULL, | |
ForkBy [varchar](100) NOT NULL, | |
ForkCreatedDate [datetime] NOT NULL | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param | |
( | |
[string]$PAT, | |
[string]$UserGitHub, | |
[string]$Connstr | |
) | |
Get-Date | |
$SQLQuery="TRUNCATE TABLE RepositoriesForks" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE [dbo].[RepositoriesBranchesAheadBehind]( | |
RepositoryId [varchar](20) NOT NULL, | |
RepositoryName [varchar](100) NOT NULL, | |
RepositoryBranchName [varchar](50) NOT NULL, | |
RepositoryBranchAheadCount [int] NULL, | |
RepositoryBranchBehindCount [int] NULL, | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param | |
( | |
[string]$PAT, | |
[string]$Organization, | |
[string]$Connstr | |
) | |
$SQLQuery = "TRUNCATE TABLE RepositoriesBranchesAheadBehind" | |
Invoke-Sqlcmd -query $SQLQuery -ConnectionString $Connstr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE [dbo].[RepositoriesBranchProtectionRules]( | |
RepositoryId [varchar](20) NOT NULL, | |
RepositoryName [varchar](100) NOT NULL, | |
RepositoryURL [varchar](300) NOT NULL, | |
DefaultBranch [varchar](50) NOT NULL, | |
RequiredSignatures [bit] NOT NULL, | |
EnforceAdmins [bit] NOT NULL, | |
RequiredLinearHistory [bit] NOT NULL, | |
AllowForcePushes [bit] NOT NULL, | |
AllowDeletions [bit] NOT NULL, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param | |
( | |
[string]$PAT, | |
[string]$Organization, | |
[string]$Connstr | |
) | |
$SQLQuery = "TRUNCATE TABLE RepositoriesBranchProtectionRules" | |
Invoke-Sqlcmd -query $SQLQuery -ConnectionString $Connstr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE [dbo].[Organization]( | |
[OrganizationId] [varchar](20) NOT NULL, | |
[OrganizationName] [varchar](100) NOT NULL, | |
CONSTRAINT [PK_Organization] PRIMARY KEY CLUSTERED | |
( | |
[OrganizationId] ASC | |
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] | |
) | |
GO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param | |
( | |
[string]$PAT, | |
[string]$Organization, | |
[string]$Connstr | |
) | |
$base64Token = [System.Convert]::ToBase64String([char[]]$PAT) | |
$headers = @{Authorization = 'Basic {0}' -f $base64Token}; | |
$UriOrganization = "https://api.github.com/orgs/$($organization)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE [dbo].[ProjectsPickLists]( | |
[TeamProjectId] [VARCHAR](40) NOT NULL, | |
[TeamProjectName] [VARCHAR](200) NOT NULL, | |
[FieldName] [VARCHAR](100) NOT NULL, | |
[FieldReferenceName] [VARCHAR](100) NOT NULL, | |
[FieldType] [VARCHAR](30) NOT NULL, | |
[FieldPickListId] [VARCHAR](40) NOT NULL, | |
[FieldPickListItems] NVARCHAR(MAX) NOT NULL | |
) | |
GO |