<commit_before>﻿CREATE TABLE [dbo].[AuthData] (
    [Id] int IDENTITY(1,1) NOT NULL,
    [PasswordHash] nvarchar(70) NULL,
    [Salt] nvarchar(30) NULL,
    [SecurityStamp] nvarchar(50) NULL,
    [LockoutEnabled] bit NOT NULL,
    [AccessFailedCnt] int NOT NULL,
    [LockoutDateUtc] datetimeoffset NULL,
    [AccessGrantedTotal] int NOT NULL,
    [LastAccessGrantedDateUtc] datetimeoffset NULL,
    [AccessFailedTotal] int NOT NULL,
    [LastAccessFailedDateUtc] datetimeoffset NULL

    CONSTRAINT [PK_AuthData] PRIMARY KEY CLUSTERED ([Id] ASC)
);
GO

CREATE TABLE [dbo].[Users] (
    [Id] int IDENTITY(1,1) NOT NULL,
    [Username] nvarchar(50) NULL,
    [Email] nvarchar(70) NULL,
    [EmailConfirmed] bit NOT NULL,
    [FirstName] nvarchar(50) NULL,
    [LastName] nvarchar(70) NULL,
    [AuthId] int NOT NULL

    CONSTRAINT [PK_Users] PRIMARY KEY CLUSTERED ([Id] ASC)
    CONSTRAINT [FK_Users_AuthId] FOREIGN KEY ([AuthId]) REFERENCES [dbo].[AuthData]([Id])
);
GO

CREATE INDEX [IX_Users_AuthId] ON [dbo].[Users]([AuthId]);
GO

CREATE TABLE [dbo].[Roles] (
    [Id] int IDENTITY(1,1) NOT NULL,
    [Name] nvarchar(50) NULL

    CONSTRAINT [PK_Roles] PRIMARY KEY CLUSTERED ([Id] ASC)
);
GO

CREATE TABLE [dbo].[UserRoles] (
    [UserId] int NOT NULL,
    [RoleId] int NOT NULL

    CONSTRAINT [PK_UserRoles] PRIMARY KEY CLUSTERED ([UserId], [RoleId] ASC)
    CONSTRAINT [FK_UserRoles_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Users]([Id]),
    CONSTRAINT [FK_UserRoles_RoleId] FOREIGN KEY ([RoleId]) REFERENCES [dbo].[Roles]([Id])
);
GO

CREATE INDEX [IX_UserRoles_RoleId] ON [dbo].[UserRoles]([RoleId]);
GO

CREATE TABLE [dbo].[ActionSources] (
    [Id] int IDENTITY(1,1) NOT NULL,
    [Name] nvarchar(100) NULL

    CONSTRAINT [PK_ActionSources] PRIMARY KEY CLUSTERED ([Id] ASC)
);
GO

CREATE TABLE [dbo].[ActionTypes] (
    [Id] int IDENTITY(1,1) NOT NULL,
    [Name] nvarchar(100) NULL

    CONSTRAINT [PK_ActionTypes] PRIMARY KEY CLUSTERED ([Id] ASC)
);
GO

CREATE TABLE [dbo].[Requests] (
    [Id] int IDENTITY(1,1) NOT NULL,
    [TargetId] int NOT NULL,
    [ActionTypeId] int NOT NULL,
    [SenderId] int NOT NULL,
    [ReceiverId] int NOT NULL

    CONSTRAINT [PK_Requests] PRIMARY KEY CLUSTERED ([Id] ASC)
    CONSTRAINT [FK_Requests_ActionTypeId] FOREIGN KEY ([ActionTypeId]) REFERENCES [dbo].[ActionTypes]([Id]),
    CONSTRAINT [FK_Requests_SenderId] FOREIGN KEY ([SenderId]) REFERENCES [dbo].[Users]([Id]),
    CONSTRAINT [FK_Requests_ReceiverId] FOREIGN KEY ([ReceiverId]) REFERENCES [dbo].[Users]([Id])
);
GO

CREATE INDEX [IX_Requests_ActionTypeId] ON [dbo].[Requests]([ActionTypeId]);
GO
CREATE INDEX [IX_Requests_SenderId] ON [dbo].[Requests]([SenderId]);
GO
CREATE INDEX [IX_Requests_ReceiverId] ON [dbo].[Requests]([ReceiverId]);
GO

CREATE TABLE [dbo].[Notifications] (
    [Id] int IDENTITY(1,1) NOT NULL,
    [TargetId] int NOT NULL,
    [ActionSourceId] int NOT NULL,
    [ActionTypeId] int NOT NULL,
    [SenderId] int NOT NULL,
    [ReceiverId] int NOT NULL

    CONSTRAINT [PK_Notifications] PRIMARY KEY CLUSTERED ([Id] ASC)
    CONSTRAINT [FK_Notifications_ActionSourceId] FOREIGN KEY ([ActionSourceId]) REFERENCES [dbo].[ActionSources]([Id]),
    CONSTRAINT [FK_Notifications_ActionTypeId] FOREIGN KEY ([ActionTypeId]) REFERENCES [dbo].[ActionTypes]([Id]),
    CONSTRAINT [FK_Notifications_SenderId] FOREIGN KEY ([SenderId]) REFERENCES [dbo].[Users]([Id]),
    CONSTRAINT [FK_Notifications_ReceiverId] FOREIGN KEY ([ReceiverId]) REFERENCES [dbo].[Users]([Id])
);
GO

CREATE INDEX [IX_Notifications_ActionSourceId] ON [dbo].[Notifications]([ActionSourceId]);
GO
CREATE INDEX [IX_Notifications_ActionTypeId] ON [dbo].[Notifications]([ActionTypeId]);
GO
CREATE INDEX [IX_Notifications_SenderId] ON [dbo].[Notifications]([SenderId]);
GO
CREATE INDEX [IX_Notifications_ReceiverId] ON [dbo].[Notifications]([ReceiverId]);
GO

CREATE TABLE [dbo].[Teams] (
    [Id] int IDENTITY(1,1) NOT NULL,
    [Name] nvarchar(100) NULL,
    [LeaderId] int NOT NULL

    CONSTRAINT [PK_Teams] PRIMARY KEY CLUSTERED ([Id] ASC)
    CONSTRAINT [FK_Teams_LeaderId] FOREIGN KEY ([LeaderId]) REFERENCES [dbo].[Users]([Id])
);
GO

CREATE INDEX [IX_Teams_LeaderId] ON [dbo].[Teams]([LeaderId]);
GO

CREATE TABLE [dbo].[UserTeams] (
    [TeamId] int NOT NULL,
    [UserId] int NOT NULL

    CONSTRAINT [PK_UserTeams] PRIMARY KEY CLUSTERED ([TeamId], [UserId] ASC)
    CONSTRAINT [FK_UserTeams_TeamId] FOREIGN KEY ([TeamId]) REFERENCES [dbo].[Teams]([Id]),
    CONSTRAINT [FK_UserTeams_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Users]([Id])
);
GO

CREATE INDEX [IX_UserTeams_UserId] ON [dbo].[UserTeams]([UserId]);
GO

CREATE TABLE [dbo].[Features] (
    [Id] int IDENTITY(1,1) NOT NULL,
    [Name] nvarchar(100) NULL,
    [Description] nvarchar(2000) NULL,
    [Version] nvarchar(50) NULL,
    [TeamId] int NOT NULL

    CONSTRAINT [PK_Features] PRIMARY KEY CLUSTERED ([Id] ASC)
    CONSTRAINT [FK_Features_TeamId] FOREIGN KEY ([Id]) REFERENCES [dbo].[Teams]([Id])
);
GO

CREATE INDEX [IX_Features_TeamId] ON [dbo].[Features]([TeamId]);
GO

CREATE TABLE [dbo].[IssueTypes] (
    [Id] int IDENTITY(1,1) NOT NULL,
    [Name] nvarchar(70) NULL

    CONSTRAINT [PK_IssueTypes] PRIMARY KEY CLUSTERED ([Id] ASC)
);
GO

CREATE TABLE [dbo].[Priorities] (
    [Id] int IDENTITY(1,1) NOT NULL,
    [Name] nvarchar(70) NULL

    CONSTRAINT [PK_Priorities] PRIMARY KEY CLUSTERED ([Id] ASC)
);
GO

CREATE TABLE [dbo].[Resolutions] (
    [Id] int IDENTITY(1,1) NOT NULL,<commit_msg>Fixed database definition.<commit_after>﻿CREATE TABLE [dbo].[AuthData] (
    [Id] int IDENTITY(1,1) NOT NULL,
    [PasswordHash] nvarchar(70) NULL,
    [Salt] nvarchar(30) NULL,
    [SecurityStamp] nvarchar(50) NULL,
    [LockoutEnabled] bit NOT NULL,
    [AccessFailedCnt] int NOT NULL,
    [LockoutDateUtc] datetimeoffset NULL,
    [AccessGrantedTotal] int NOT NULL,
    [LastAccessGrantedDateUtc] datetimeoffset NULL,
    [AccessFailedTotal] int NOT NULL,
    [LastAccessFailedDateUtc] datetimeoffset NULL

    CONSTRAINT [PK_AuthData] PRIMARY KEY CLUSTERED ([Id] ASC)
);
GO

CREATE TABLE [dbo].[Users] (
    [Id] int IDENTITY(1,1) NOT NULL,
    [Username] nvarchar(50) NULL,
    [Email] nvarchar(70) NULL,
    [EmailConfirmed] bit NOT NULL,
    [FirstName] nvarchar(50) NULL,
    [LastName] nvarchar(70) NULL,
    [AuthId] int NOT NULL

    CONSTRAINT [PK_Users] PRIMARY KEY CLUSTERED ([Id] ASC)
    CONSTRAINT [FK_Users_AuthId] FOREIGN KEY ([AuthId]) REFERENCES [dbo].[AuthData]([Id])
);
GO

CREATE INDEX [IX_Users_AuthId] ON [dbo].[Users]([AuthId]);
GO

CREATE TABLE [dbo].[Roles] (
    [Id] int IDENTITY(1,1) NOT NULL,
    [Name] nvarchar(50) NULL

    CONSTRAINT [PK_Roles] PRIMARY KEY CLUSTERED ([Id] ASC)
);
GO

CREATE TABLE [dbo].[UserRoles] (
    [UserId] int NOT NULL,
    [RoleId] int NOT NULL

    CONSTRAINT [PK_UserRoles] PRIMARY KEY CLUSTERED ([UserId], [RoleId] ASC)
    CONSTRAINT [FK_UserRoles_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Users]([Id]),
    CONSTRAINT [FK_UserRoles_RoleId] FOREIGN KEY ([RoleId]) REFERENCES [dbo].[Roles]([Id])
);
GO

CREATE INDEX [IX_UserRoles_RoleId] ON [dbo].[UserRoles]([RoleId]);
GO

CREATE TABLE [dbo].[ActionSources] (
    [Id] int IDENTITY(1,1) NOT NULL,
    [Name] nvarchar(100) NULL

    CONSTRAINT [PK_ActionSources] PRIMARY KEY CLUSTERED ([Id] ASC)
);
GO

CREATE TABLE [dbo].[ActionTypes] (
    [Id] int IDENTITY(1,1) NOT NULL,
    [Name] nvarchar(100) NULL

    CONSTRAINT [PK_ActionTypes] PRIMARY KEY CLUSTERED ([Id] ASC)
);
GO

CREATE TABLE [dbo].[Requests] (
    [Id] int IDENTITY(1,1) NOT NULL,
    [TargetId] int NOT NULL,
    [ActionTypeId] int NOT NULL,
    [SenderId] int NOT NULL,
    [ReceiverId] int NOT NULL

    CONSTRAINT [PK_Requests] PRIMARY KEY CLUSTERED ([Id] ASC)
    CONSTRAINT [FK_Requests_ActionTypeId] FOREIGN KEY ([ActionTypeId]) REFERENCES [dbo].[ActionTypes]([Id]),
    CONSTRAINT [FK_Requests_SenderId] FOREIGN KEY ([SenderId]) REFERENCES [dbo].[Users]([Id]),
    CONSTRAINT [FK_Requests_ReceiverId] FOREIGN KEY ([ReceiverId]) REFERENCES [dbo].[Users]([Id])
);
GO

CREATE INDEX [IX_Requests_ActionTypeId] ON [dbo].[Requests]([ActionTypeId]);
GO
CREATE INDEX [IX_Requests_SenderId] ON [dbo].[Requests]([SenderId]);
GO
CREATE INDEX [IX_Requests_ReceiverId] ON [dbo].[Requests]([ReceiverId]);
GO

CREATE TABLE [dbo].[Notifications] (
    [Id] int IDENTITY(1,1) NOT NULL,
    [TargetId] int NOT NULL,
    [ActionSourceId] int NOT NULL,
    [ActionTypeId] int NOT NULL,
    [SenderId] int NOT NULL,
    [ReceiverId] int NOT NULL

    CONSTRAINT [PK_Notifications] PRIMARY KEY CLUSTERED ([Id] ASC)
    CONSTRAINT [FK_Notifications_ActionSourceId] FOREIGN KEY ([ActionSourceId]) REFERENCES [dbo].[ActionSources]([Id]),
    CONSTRAINT [FK_Notifications_ActionTypeId] FOREIGN KEY ([ActionTypeId]) REFERENCES [dbo].[ActionTypes]([Id]),
    CONSTRAINT [FK_Notifications_SenderId] FOREIGN KEY ([SenderId]) REFERENCES [dbo].[Users]([Id]),
    CONSTRAINT [FK_Notifications_ReceiverId] FOREIGN KEY ([ReceiverId]) REFERENCES [dbo].[Users]([Id])
);
GO

CREATE INDEX [IX_Notifications_ActionSourceId] ON [dbo].[Notifications]([ActionSourceId]);
GO
CREATE INDEX [IX_Notifications_ActionTypeId] ON [dbo].[Notifications]([ActionTypeId]);
GO
CREATE INDEX [IX_Notifications_SenderId] ON [dbo].[Notifications]([SenderId]);
GO
CREATE INDEX [IX_Notifications_ReceiverId] ON [dbo].[Notifications]([ReceiverId]);
GO

CREATE TABLE [dbo].[Teams] (
    [Id] int IDENTITY(1,1) NOT NULL,
    [Name] nvarchar(100) NULL,
    [LeaderId] int NOT NULL

    CONSTRAINT [PK_Teams] PRIMARY KEY CLUSTERED ([Id] ASC)
    CONSTRAINT [FK_Teams_LeaderId] FOREIGN KEY ([LeaderId]) REFERENCES [dbo].[Users]([Id])
);
GO

CREATE INDEX [IX_Teams_LeaderId] ON [dbo].[Teams]([LeaderId]);
GO

CREATE TABLE [dbo].[UserTeams] (
    [TeamId] int NOT NULL,
    [UserId] int NOT NULL

    CONSTRAINT [PK_UserTeams] PRIMARY KEY CLUSTERED ([TeamId], [UserId] ASC)
    CONSTRAINT [FK_UserTeams_TeamId] FOREIGN KEY ([TeamId]) REFERENCES [dbo].[Teams]([Id]),
    CONSTRAINT [FK_UserTeams_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Users]([Id])
);
GO

CREATE INDEX [IX_UserTeams_UserId] ON [dbo].[UserTeams]([UserId]);
GO

CREATE TABLE [dbo].[Features] (
    [Id] int IDENTITY(1,1) NOT NULL,
    [Name] nvarchar(100) NULL,
    [Description] nvarchar(2000) NULL,
    [Version] nvarchar(50) NULL,
    [TeamId] int NOT NULL

    CONSTRAINT [PK_Features] PRIMARY KEY CLUSTERED ([Id] ASC)
    CONSTRAINT [FK_Features_TeamId] FOREIGN KEY ([TeamId]) REFERENCES [dbo].[Teams]([Id])
);
GO

CREATE INDEX [IX_Features_TeamId] ON [dbo].[Features]([TeamId]);
GO

CREATE TABLE [dbo].[IssueTypes] (
    [Id] int IDENTITY(1,1) NOT NULL,
    [Name] nvarchar(70) NULL

    CONSTRAINT [PK_IssueTypes] PRIMARY KEY CLUSTERED ([Id] ASC)
);
GO

CREATE TABLE [dbo].[Priorities] (
    [Id] int IDENTITY(1,1) NOT NULL,
    [Name] nvarchar(70) NULL

    CONSTRAINT [PK_Priorities] PRIMARY KEY CLUSTERED ([Id] ASC)
);
GO

CREATE TABLE [dbo].[Resolutions] (
    [Id] int IDENTITY(1,1) NOT NULL,
{'fraction_non_alphanumeric': 0.1402056227822764, 'fraction_numerical': 0.011281957965608226, 'mean_word_length': 4.871794871794871, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1674513', 'n_tokens_mistral': 4410, 'n_tokens_neox': 4099, 'n_words': 1039}