CREATE DATABASE TechDev go USE TechDev GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ============================================= -- Author: -- Create date: -- Description: -- ============================================= CREATE PROCEDURE [dbo].[UniversalCascadeDelete] -- Add the parameters for the stored procedure here @tableName VARCHAR(200), @baseCriteria NVARCHAR(1000) AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; DECLARE @deleteSQL NVARCHAR(900) CREATE TABLE #DeleteCascade ( DeleteSQL NVARCHAR(900) ) INSERT INTO #DeleteCascade EXEC usp_delete_cascade @tableName, @baseCriteria DECLARE DeleteCursor CURSOR FOR SELECT * FROM #DeleteCascade OPEN DeleteCursor FETCH NEXT FROM DeleteCursor INTO @deleteSQL WHILE @@FETCH_STATUS = 0 BEGIN EXEC sp_executesql @deleteSQL FETCH NEXT FROM DeleteCursor INTO @deleteSQL END CLOSE DeleteCursor DEALLOCATE DeleteCursor DROP TABLE #DeleteCascade END GO /****** Object: StoredProcedure [dbo].[usp_delete_cascade] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- Author: Kevin Conner -- Source: http://stackoverflow.com/questions/116968/in-sql-server-2005-can-i-do-a-cascade-delete-without-setting-the-property-on-my CREATE procedure [dbo].[usp_delete_cascade] ( @base_table_name varchar(200), @base_criteria nvarchar(1000) ) as begin -- Adapted from http://www.sqlteam.com/article/performing-a-cascade-delete-in-sql-server-7 -- Expects the name of a table, and a conditional for selecting rows -- within that table that you want deleted. -- Produces SQL that, when run, deletes all table rows referencing the ones -- you initially selected, cascading into any number of tables, -- without the need for "ON DELETE CASCADE". -- Does not appear to work with self-referencing tables, but it will -- delete everything beneath them. -- To make it easy on the server, put a "GO" statement between each line. declare @to_delete table ( id int identity(1, 1) primary key not null, criteria nvarchar(1000) not null, table_name varchar(200) not null, processed bit not null, delete_sql varchar(1000) ) insert into @to_delete (criteria, table_name, processed) values (@base_criteria, @base_table_name, 0) declare @id int, @criteria nvarchar(1000), @table_name varchar(200) while exists(select 1 from @to_delete where processed = 0) begin select top 1 @id = id, @criteria = criteria, @table_name = table_name from @to_delete where processed = 0 order by id desc insert into @to_delete (criteria, table_name, processed) select referencing_column.name + ' in (select [' + referenced_column.name + '] from [' + @table_name +'] where ' + @criteria + ')', referencing_table.name, 0 from sys.foreign_key_columns fk inner join sys.columns referencing_column on fk.parent_object_id = referencing_column.object_id and fk.parent_column_id = referencing_column.column_id inner join sys.columns referenced_column on fk.referenced_object_id = referenced_column.object_id and fk.referenced_column_id = referenced_column.column_id inner join sys.objects referencing_table on fk.parent_object_id = referencing_table.object_id inner join sys.objects referenced_table on fk.referenced_object_id = referenced_table.object_id inner join sys.objects constraint_object on fk.constraint_object_id = constraint_object.object_id where referenced_table.name = @table_name and referencing_table.name != referenced_table.name update @to_delete set processed = 1 where id = @id end select 'print ''deleting from ' + table_name + '...''; delete from [' + table_name + '] where ' + criteria from @to_delete order by id desc end GO /****** Object: Table [dbo].[AccessLog] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[AccessLog]( [ID] [int] IDENTITY(1,1) NOT NULL, [UserName] [varchar](200) NOT NULL, [AccessGranted] [bit] NOT NULL, [CreatedOn] [datetime] NOT NULL, PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO SET ANSI_PADDING OFF GO /****** Object: Table [dbo].[ApplicationRole] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[ApplicationRole]( [ID] [uniqueidentifier] NOT NULL, [Name] [varchar](200) NOT NULL, [Description] [varchar](max) NULL, [NodeID] [uniqueidentifier] NOT NULL, [CreatedOn] [datetime] NOT NULL, [CreatedBy] [varchar](200) NOT NULL, [UpdatedOn] [datetime] NOT NULL, [UpdatedBy] [varchar](200) NOT NULL, PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO SET ANSI_PADDING OFF GO /****** Object: Table [dbo].[ApplicationRoleSecurityGroup] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[ApplicationRoleSecurityGroup]( [ApplicationRoleID] [uniqueidentifier] NOT NULL, [SecurityGroupID] [uniqueidentifier] NOT NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[ApplicationRoleUserAccount] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[ApplicationRoleUserAccount]( [ApplicationRoleID] [uniqueidentifier] NOT NULL, [UserAccountID] [uniqueidentifier] NOT NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[Degree] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[Degree]( [ID] [int] IDENTITY(1,1) NOT NULL, [Name] [varchar](200) NULL, [Description] [varchar](max) NULL, PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO SET ANSI_PADDING OFF GO /****** Object: Table [dbo].[Department] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[Department]( [ID] [int] IDENTITY(1,1) NOT NULL, [Name] [varchar](200) NOT NULL, [Description] [varchar](max) NULL, [ManagerID] [uniqueidentifier] NOT NULL, PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO SET ANSI_PADDING OFF GO /****** Object: Table [dbo].[Document] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[Document]( [ID] [int] IDENTITY(1,1) NOT NULL, [Filename] [varchar](200) NOT NULL, [DocumentTypeKey] [int] NULL, [DocumentBlob] [varbinary](max) NULL, [Enabled] [bit] NOT NULL, [CreatedOn] [datetime] NOT NULL, [CreatedByID] [uniqueidentifier] NOT NULL, PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO SET ANSI_PADDING OFF GO /****** Object: Table [dbo].[EngineerInformation] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[EngineerInformation]( [EngineerID] [uniqueidentifier] NOT NULL, [JobTitleID] [int] NULL, [DegreeID] [int] NULL, [HasPE] [bit] NOT NULL, [Dormant] [bit] NOT NULL, PRIMARY KEY CLUSTERED ( [EngineerID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO /****** Object: Table [dbo].[EngineerTraining] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[EngineerTraining]( [ID] [int] IDENTITY(1,1) NOT NULL, [EngineerID] [uniqueidentifier] NOT NULL, [TrainingID] [int] NOT NULL, [CompletedOn] [date] NULL, PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO /****** Object: Table [dbo].[ErrorLog] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[ErrorLog]( [ID] [int] IDENTITY(1,1) NOT NULL, [Source] [varchar](200) NOT NULL, [Type] [varchar](max) NULL, [Message] [varchar](max) NOT NULL, [Detail] [varchar](max) NULL, [CreatedOn] [datetime] NOT NULL, PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO SET ANSI_PADDING OFF GO /****** Object: Table [dbo].[EvaluationType] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[EvaluationType]( [ID] [int] IDENTITY(1,1) NOT NULL, [Name] [varchar](200) NOT NULL, [Description] [varchar](max) NULL, [CreatedOn] [datetime] NOT NULL, [CreatedBy] [varchar](max) NOT NULL, PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO SET ANSI_PADDING OFF GO /****** Object: Table [dbo].[Factor] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[Factor]( [ID] [int] IDENTITY(1,1) NOT NULL, [EvaluationTypeID] [int] NOT NULL, [Name] [varchar](200) NOT NULL, [Description] [varchar](max) NULL, [CreatedOn] [datetime] NULL, [CreatedBy] [varchar](max) NULL, [UpdatedOn] [datetime] NULL, [UpdatedBy] [varchar](max) NULL, PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO SET ANSI_PADDING OFF GO /****** Object: Table [dbo].[FactorEvidence] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[FactorEvidence]( [ID] [int] IDENTITY(1,1) NOT NULL, [UserAccountID] [uniqueidentifier] NOT NULL, [FactorID] [int] NOT NULL, [Description] [varchar](max) NULL, [Name] [varchar](max) NULL, [EndDate] [datetime] NOT NULL, [StartDate] [datetime] NULL, [CreatedOn] [datetime] NOT NULL, [CreatedBy] [varchar](max) NOT NULL, [UpdatedOn] [datetime] NULL, [UpdatedBy] [varchar](max) NULL, PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO SET ANSI_PADDING OFF GO /****** Object: Table [dbo].[FactorEvidenceDocument] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[FactorEvidenceDocument]( [FactorEvidenceID] [int] NOT NULL, [DocumentID] [int] NOT NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[ManagerEngineer] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[ManagerEngineer]( [ID] [int] IDENTITY(1,1) NOT NULL, [ManagerID] [uniqueidentifier] NOT NULL, [EngineerID] [uniqueidentifier] NOT NULL, PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO /****** Object: Table [dbo].[Menu] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[Menu]( [ID] [int] IDENTITY(1,1) NOT NULL, [Name] [varchar](64) NULL, [Abbreviation] [varchar](12) NULL, [Description] [varchar](max) NULL, [CreatedOn] [datetime] NOT NULL, PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO SET ANSI_PADDING OFF GO /****** Object: Table [dbo].[MenuItem] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[MenuItem]( [ID] [int] IDENTITY(1,1) NOT NULL, [MenuID] [int] NOT NULL, [PageID] [int] NOT NULL, [Image] [varchar](200) NOT NULL, [ImageAlt] [varchar](200) NULL, [Text] [varchar](50) NOT NULL, [Link] [varchar](200) NULL, [SortOrder] [int] NULL, [Description] [varchar](max) NULL, [Enabled] [bit] NOT NULL, PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO SET ANSI_PADDING OFF GO /****** Object: Table [dbo].[Node] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[Node]( [ID] [uniqueidentifier] NOT NULL, [Name] [varchar](200) NOT NULL, [Description] [varchar](max) NULL, [Enabled] [bit] NOT NULL, [CreatedOn] [datetime] NOT NULL, [CreatedBy] [varchar](200) NOT NULL, [UpdatedOn] [datetime] NOT NULL, [UpdatedBy] [varchar](200) NOT NULL, PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO SET ANSI_PADDING OFF GO /****** Object: Table [dbo].[Page] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[Page]( [ID] [int] IDENTITY(1,1) NOT NULL, [Name] [varchar](64) NOT NULL, [Title] [varchar](64) NOT NULL, [MenuID] [int] NOT NULL, [PageLocation] [varchar](200) NOT NULL, [ServerConfiguration] [varchar](max) NULL, [ClientConfiguration] [varchar](max) NULL, [IncludedRoles] [varchar](200) NULL, [ExcludedRoles] [varchar](200) NULL, [Description] [varchar](max) NULL, [Enabled] [bit] NOT NULL, [CreatedOn] [datetime] NULL, PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO SET ANSI_PADDING OFF GO /****** Object: Table [dbo].[Score] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[Score]( [ID] [int] IDENTITY(1,1) NOT NULL, [UserAccountID] [uniqueidentifier] NOT NULL, [FactorID] [int] NOT NULL, [Description] [varchar](max) NULL, [Value] [varchar](max) NULL, [CreatedOn] [datetime] NULL, [CreatedBy] [varchar](max) NULL, [UpdatedOn] [datetime] NULL, [UpdatedBy] [varchar](max) NULL, PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO SET ANSI_PADDING OFF GO /****** Object: Table [dbo].[SecurityGroup] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[SecurityGroup]( [ID] [uniqueidentifier] NOT NULL, [Name] [varchar](200) NOT NULL, [Description] [varchar](max) NULL, [CreatedOn] [datetime] NOT NULL, [CreatedBy] [varchar](200) NOT NULL, [UpdatedOn] [datetime] NOT NULL, [UpdatedBy] [varchar](200) NOT NULL, PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO SET ANSI_PADDING OFF GO /****** Object: Table [dbo].[SecurityGroupUserAccount] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[SecurityGroupUserAccount]( [SecurityGroupID] [uniqueidentifier] NOT NULL, [UserAccountID] [uniqueidentifier] NOT NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[Settings] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[Settings]( [ID] [int] IDENTITY(1,1) NOT NULL, [Scope] [varchar](64) NULL, [Name] [varchar](64) NULL, [Value] [varchar](512) NULL, [ApplicationInstance] [bit] NOT NULL, [Roles] [varchar](200) NULL, PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO SET ANSI_PADDING OFF GO /****** Object: Table [dbo].[Training] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[Training]( [ID] [int] IDENTITY(1,1) NOT NULL, [Name] [varchar](200) NOT NULL, [ShortName] [varchar](5) NOT NULL, [Description] [varchar](max) NULL, PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO SET ANSI_PADDING OFF GO /****** Object: Table [dbo].[TrainingDegree] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[TrainingDegree]( [ID] [int] IDENTITY(1,1) NOT NULL, [TrainingID] [int] NOT NULL, [DegreeID] [int] NOT NULL, PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO /****** Object: Table [dbo].[UserAccount] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[UserAccount]( [ID] [uniqueidentifier] NOT NULL, [Name] [varchar](200) NOT NULL, [Password] [varchar](200) NULL, [FirstName] [varchar](200) NULL, [LastName] [varchar](200) NULL, [DefaultNodeID] [uniqueidentifier] NOT NULL, [Phone] [varchar](200) NULL, [Email] [varchar](200) NULL, [LockedOut] [bit] NOT NULL, [UseADAuthentication] [bit] NOT NULL, [ChangePasswordOn] [datetime] NULL, [CreatedOn] [datetime] NOT NULL, [CreatedBy] [varchar](50) NOT NULL, [UpdatedOn] [datetime] NOT NULL, [UpdatedBy] [varchar](50) NOT NULL, PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO SET ANSI_PADDING OFF GO /****** Object: Table [dbo].[ValueList] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[ValueList]( [ID] [int] IDENTITY(1,1) NOT NULL, [GroupID] [int] NOT NULL, [Key] [int] NOT NULL, [Text] [varchar](200) NULL, [AltText1] [varchar](200) NULL, [AltText2] [varchar](200) NULL, [Abbreviation] [varchar](12) NULL, [Value] [int] NULL, [Flag] [bit] NOT NULL, [Description] [varchar](max) NULL, [SortOrder] [int] NULL, [IsDefault] [bit] NOT NULL, [Hidden] [bit] NOT NULL, [Enabled] [bit] NOT NULL, [CreatedOn] [datetime] NOT NULL, PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO SET ANSI_PADDING OFF GO /****** Object: Table [dbo].[ValueListGroup] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[ValueListGroup]( [ID] [int] IDENTITY(1,1) NOT NULL, [Name] [varchar](200) NULL, [Description] [varchar](max) NULL, [Enabled] [bit] NOT NULL, [CreatedOn] [datetime] NULL, PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO SET ANSI_PADDING OFF GO /****** Object: UserDefinedFunction [dbo].[RecursiveEmployeeSearch] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE FUNCTION [dbo].[RecursiveEmployeeSearch](@managerID uniqueidentifier) RETURNS TABLE AS RETURN WITH ManagerHeirarchy AS ( SELECT ManagerID, EngineerID FROM ManagerEngineer WHERE ManagerID = @managerID -- anchor member UNION ALL SELECT b.ManagerID, a.EngineerID -- recursive member FROM ManagerEngineer as a join ManagerHeirarchy as b ON b.EngineerID = a.ManagerID ) SELECT ID FROM UserAccount JOIN ManagerHeirarchy ON UserAccount.ID = ManagerHeirarchy.EngineerID GO /****** Object: View [dbo].[DocumentDetail] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE VIEW [dbo].[DocumentDetail] AS SELECT 'FactorEvidence' AS SourceTable, FactorEvidenceDocument.FactorEvidenceID AS SourceID, Document.ID AS DocumentID, Filename, Document.DocumentTypeKey, Document.Enabled, Document.CreatedOn, Document.CreatedByID FROM dbo.[Document] INNER JOIN FactorEvidenceDocument ON dbo.[Document].ID = dbo.FactorEvidenceDocument.DocumentID GO /****** Object: View [dbo].[EngineerView] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ? CREATE VIEW [dbo].[EngineerView] AS SELECT ManagerEngineer.ID, ManagerEngineer.ManagerID, ManagerEngineer.EngineerID, CASE WHEN (SELECT ID FROM ApplicationRole WHERE Name = 'DepartmentManager') IN (SELECT ApplicationRoleID FROM ApplicationRoleUserAccount WHERE UserAccountID = UserAccount.ID) THEN 'Dpt Manager' WHEN (SELECT ID FROM ApplicationRole WHERE Name = 'Manager') IN (SELECT ApplicationRoleID FROM ApplicationRoleUserAccount WHERE UserAccountID = UserAccount.ID) THEN 'Manager' ELSE 'Engineer' END as Role, UserAccount.FirstName + ' ' + UserAccount.LastName as Name, EngineerInformation.JobTitleID, ValueList.Text as JobTitle, EngineerInformation.DegreeID, Degree.Name as Degree, EngineerInformation.HasPE, EngineerInformation.Dormant FROM ManagerEngineer JOIN UserAccount ON ManagerEngineer.EngineerID = UserAccount.ID Left JOIN EngineerInformation ON ManagerEngineer.EngineerID = EngineerInformation.EngineerID LEFT JOIN ValueList ON EngineerInformation.JobTitleID = Valuelist.ID LEFT JOIN Degree ON EngineerInformation.DegreeID = Degree.ID GO /****** Object: View [dbo].[ScoreFactorUserAccount] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO Create VIEW [dbo].[ScoreFactorUserAccount] as SELECT Factor.Name, Factor.ID as FactorID, Factor.EvaluationTypeID, Score.ID as ID, Score.CreatedOn, Score.Value, Score.UserAccountID, Score.Description FROM Factor LEFT JOIN Score ON Factor.ID = Score.FactorID GO /****** Object: View [dbo].[ScoreFactorView] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE VIEW [dbo].[ScoreFactorView] as SELECT Factor.ID as FactorID, Score.Value, Factor.EvaluationTypeID, Factor.Name FROM Factor LEFT JOIN ( SELECT FactorID, UserAccountID, Max(CreatedOn) as Date FROM Score GROUP BY FactorID, UserAccountID ) as Score1 ON Score1.FactorID = Factor.ID LEFT JOIN Score ON Score1.Date = Score.CreatedOn AND Score1.FactorID = Score.FactorID AND Score1.UserAccountID = Score.UserAccountID WHERE Score.Value IS NOT NULL GO /****** Object: View [dbo].[UserAccountView] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE VIEW [dbo].[UserAccountView] AS SELECT UserAccount.*, UserAccount.FirstName + ' ' + UserAccount.LastName as FullName, ApplicationRole.Name as Role, ApplicationRole.Name + ': ' + UserAccount.FirstName + ' ' + UserAccount.LastName as NameRole FROM UserAccount JOIN ApplicationRole ON ApplicationRole.ID IN (SELECT ApplicationRoleID FROM ApplicationRoleUserAccount WHERE UserAccountID = UserAccount.ID) GO /****** Object: View [dbo].[UserScoreView] Script Date: 6/5/2020 3:49:38 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE VIEW [dbo].[UserScoreView] AS WITH ManagerHeirarchy AS ( SELECT ManagerID, EngineerID FROM ManagerEngineer WHERE ManagerID IN (SELECT ManagerID FROM Department) -- anchor member UNION ALL SELECT b.ManagerID, a.EngineerID -- recursive member FROM ManagerEngineer as a join ManagerHeirarchy as b ON b.EngineerID = a.ManagerID ) SELECT UserAccount.ID as UserAccountID, Score.ID, Score.FactorID, Score.Value, Score.Description, Score.CreatedOn, Score.CreatedBy, Score.UpdatedOn, Score.UpdatedBy, Department.ID as DepartmentID FROM UserAccount LEFT JOIN Score ON UserAccount.ID = Score.UserAccountID LEFT JOIN ManagerHeirarchy ON UserAccount.ID = ManagerHeirarchy.EngineerID LEFT JOIN Department ON ManagerHeirarchy.ManagerID = Department.ManagerID GO INSERT [dbo].[ApplicationRole] ([ID], [Name], [Description], [NodeID], [CreatedOn], [CreatedBy], [UpdatedOn], [UpdatedBy]) VALUES (N'cc8ebe6e-e319-4af8-b425-2c8f376bf20b', N'Engineer', N'Engineer Role', N'00000000-0000-0000-0000-000000000000', CAST(N'2019-01-30 10:07:17.237' AS DateTime), N'dbo', CAST(N'2019-01-30 10:07:17.237' AS DateTime), N'dbo') GO INSERT [dbo].[ApplicationRole] ([ID], [Name], [Description], [NodeID], [CreatedOn], [CreatedBy], [UpdatedOn], [UpdatedBy]) VALUES (N'216ea2e9-d15b-4a24-b645-3d7a31d8ce3f', N'Administrator', N'Admin Role', N'00000000-0000-0000-0000-000000000000', CAST(N'2019-01-30 10:07:17.227' AS DateTime), N'dbo', CAST(N'2019-01-30 10:07:17.227' AS DateTime), N'dbo') GO INSERT [dbo].[ApplicationRole] ([ID], [Name], [Description], [NodeID], [CreatedOn], [CreatedBy], [UpdatedOn], [UpdatedBy]) VALUES (N'95bf34ba-1a24-4f4d-91e7-4c6573d8dfdb', N'DepartmentManager', N'Department Manager Role', N'00000000-0000-0000-0000-000000000000', CAST(N'2019-01-30 10:07:17.233' AS DateTime), N'dbo', CAST(N'2019-01-30 10:07:17.233' AS DateTime), N'dbo') GO INSERT [dbo].[ApplicationRole] ([ID], [Name], [Description], [NodeID], [CreatedOn], [CreatedBy], [UpdatedOn], [UpdatedBy]) VALUES (N'd5789158-3a30-4564-a047-81e86c18ae98', N'Manager', N'Manager Role', N'00000000-0000-0000-0000-000000000000', CAST(N'2019-01-30 10:07:17.233' AS DateTime), N'dbo', CAST(N'2019-01-30 10:07:17.233' AS DateTime), N'dbo') GO INSERT [dbo].[ApplicationRoleSecurityGroup] ([ApplicationRoleID], [SecurityGroupID]) VALUES (N'216ea2e9-d15b-4a24-b645-3d7a31d8ce3f', N'6d9c98ca-d187-41fa-bcf6-2bd9fcf26914') GO SET IDENTITY_INSERT [dbo].[Degree] ON GO INSERT [dbo].[Degree] ([ID], [Name], [Description]) VALUES (1, N'ME', N'Mechanical Engineer') GO INSERT [dbo].[Degree] ([ID], [Name], [Description]) VALUES (2, N'EE', N'Electrical Engineer') GO INSERT [dbo].[Degree] ([ID], [Name], [Description]) VALUES (3, N'CE', N'Civl Engineer') GO INSERT [dbo].[Degree] ([ID], [Name], [Description]) VALUES (4, N'TECH', N'Engineering Technician') GO SET IDENTITY_INSERT [dbo].[Degree] OFF GO SET IDENTITY_INSERT [dbo].[EvaluationType] ON GO INSERT [dbo].[EvaluationType] ([ID], [Name], [Description], [CreatedOn], [CreatedBy]) VALUES (1, N'Main Categories', N'Main Categories', CAST(N'2019-01-30 10:08:26.007' AS DateTime), N'dbo') GO INSERT [dbo].[EvaluationType] ([ID], [Name], [Description], [CreatedOn], [CreatedBy]) VALUES (2, N'Technical Skills', N'Technical Skills', CAST(N'2019-01-30 10:08:26.010' AS DateTime), N'dbo') GO INSERT [dbo].[EvaluationType] ([ID], [Name], [Description], [CreatedOn], [CreatedBy]) VALUES (3, N'Experience Areas', N'Experience Areas', CAST(N'2019-01-30 10:08:26.010' AS DateTime), N'dbo') GO INSERT [dbo].[EvaluationType] ([ID], [Name], [Description], [CreatedOn], [CreatedBy]) VALUES (4, N'Core Skills', N'Core Skills', CAST(N'2019-01-30 10:08:26.013' AS DateTime), N'dbo') GO SET IDENTITY_INSERT [dbo].[EvaluationType] OFF GO SET IDENTITY_INSERT [dbo].[Factor] ON GO INSERT [dbo].[Factor] ([ID], [EvaluationTypeID], [Name], [Description], [CreatedOn], [CreatedBy], [UpdatedOn], [UpdatedBy]) VALUES (1, 1, N'Composite Technical Skills Score', NULL, CAST(N'2019-01-30 10:08:33.430' AS DateTime), N'dbo', NULL, NULL) GO INSERT [dbo].[Factor] ([ID], [EvaluationTypeID], [Name], [Description], [CreatedOn], [CreatedBy], [UpdatedOn], [UpdatedBy]) VALUES (2, 1, N'Composite Breadth of Experience Score', NULL, CAST(N'2019-01-30 10:08:33.450' AS DateTime), N'dbo', NULL, NULL) GO INSERT [dbo].[Factor] ([ID], [EvaluationTypeID], [Name], [Description], [CreatedOn], [CreatedBy], [UpdatedOn], [UpdatedBy]) VALUES (3, 1, N'Composite Core Skills Score', NULL, CAST(N'2019-01-30 10:08:33.453' AS DateTime), N'dbo', NULL, NULL) GO INSERT [dbo].[Factor] ([ID], [EvaluationTypeID], [Name], [Description], [CreatedOn], [CreatedBy], [UpdatedOn], [UpdatedBy]) VALUES (4, 4, N'A Core skill', NULL, NULL, NULL, NULL, NULL) GO INSERT [dbo].[Factor] ([ID], [EvaluationTypeID], [Name], [Description], [CreatedOn], [CreatedBy], [UpdatedOn], [UpdatedBy]) VALUES (5, 4, N'A 2nd Core Skill', NULL, NULL, NULL, NULL, NULL) GO INSERT [dbo].[Factor] ([ID], [EvaluationTypeID], [Name], [Description], [CreatedOn], [CreatedBy], [UpdatedOn], [UpdatedBy]) VALUES (6, 3, N'An Area', NULL, NULL, NULL, NULL, NULL) GO INSERT [dbo].[Factor] ([ID], [EvaluationTypeID], [Name], [Description], [CreatedOn], [CreatedBy], [UpdatedOn], [UpdatedBy]) VALUES (7, 3, N'2nd Area', NULL, NULL, NULL, NULL, NULL) GO INSERT [dbo].[Factor] ([ID], [EvaluationTypeID], [Name], [Description], [CreatedOn], [CreatedBy], [UpdatedOn], [UpdatedBy]) VALUES (8, 2, N'A Tech Skill', NULL, NULL, NULL, NULL, NULL) GO INSERT [dbo].[Factor] ([ID], [EvaluationTypeID], [Name], [Description], [CreatedOn], [CreatedBy], [UpdatedOn], [UpdatedBy]) VALUES (9, 2, N'A 2nd Tech Skill', NULL, NULL, NULL, NULL, NULL) GO INSERT [dbo].[Factor] ([ID], [EvaluationTypeID], [Name], [Description], [CreatedOn], [CreatedBy], [UpdatedOn], [UpdatedBy]) VALUES (15, 4, N'test skill 2', NULL, NULL, NULL, NULL, NULL) GO INSERT [dbo].[Factor] ([ID], [EvaluationTypeID], [Name], [Description], [CreatedOn], [CreatedBy], [UpdatedOn], [UpdatedBy]) VALUES (16, 3, N'test area', NULL, NULL, NULL, NULL, NULL) GO INSERT [dbo].[Factor] ([ID], [EvaluationTypeID], [Name], [Description], [CreatedOn], [CreatedBy], [UpdatedOn], [UpdatedBy]) VALUES (17, 2, N'test tech skill', NULL, NULL, NULL, NULL, NULL) GO INSERT [dbo].[Factor] ([ID], [EvaluationTypeID], [Name], [Description], [CreatedOn], [CreatedBy], [UpdatedOn], [UpdatedBy]) VALUES (1010, 2, N'test tech skill 2', NULL, NULL, NULL, NULL, NULL) GO SET IDENTITY_INSERT [dbo].[Factor] OFF GO SET IDENTITY_INSERT [dbo].[Menu] ON GO INSERT [dbo].[Menu] ([ID], [Name], [Abbreviation], [Description], [CreatedOn]) VALUES (1, N'All Menus', N'All', N'Menu items that appear in all menus (except null)', CAST(N'2019-01-30 10:07:33.477' AS DateTime)) GO INSERT [dbo].[Menu] ([ID], [Name], [Abbreviation], [Description], [CreatedOn]) VALUES (2, N'Home', N'Home', N'Base Menu', CAST(N'2019-01-30 10:07:33.480' AS DateTime)) GO INSERT [dbo].[Menu] ([ID], [Name], [Abbreviation], [Description], [CreatedOn]) VALUES (3, N'Application Settings', N'AppSettings', N'Application Settings Menu', CAST(N'2019-01-30 10:07:33.483' AS DateTime)) GO INSERT [dbo].[Menu] ([ID], [Name], [Abbreviation], [Description], [CreatedOn]) VALUES (4, N'System Settings', N'SysSettings', N'System Settings Menu', CAST(N'2019-01-30 10:07:33.487' AS DateTime)) GO INSERT [dbo].[Menu] ([ID], [Name], [Abbreviation], [Description], [CreatedOn]) VALUES (5, N'Null', N'Null', N'No Menu will be displayed for this menu designation', CAST(N'2019-01-30 10:07:33.490' AS DateTime)) GO SET IDENTITY_INSERT [dbo].[Menu] OFF GO INSERT [dbo].[Node] ([ID], [Name], [Description], [Enabled], [CreatedOn], [CreatedBy], [UpdatedOn], [UpdatedBy]) VALUES (N'00000000-0000-0000-0000-000000000000', N'Default', NULL, 1, CAST(N'2019-01-30 10:07:08.660' AS DateTime), N'Installer', CAST(N'2019-01-30 10:07:08.660' AS DateTime), N'Installer') GO SET IDENTITY_INSERT [dbo].[Page] ON GO INSERT [dbo].[Page] ([ID], [Name], [Title], [MenuID], [PageLocation], [ServerConfiguration], [ClientConfiguration], [IncludedRoles], [ExcludedRoles], [Description], [Enabled], [CreatedOn]) VALUES (1, N'HomeEngineer', N'My Overview', 2, N'~/Home/HomeEngineer', NULL, NULL, N'Engineer', NULL, NULL, 1, CAST(N'2019-01-30 10:07:41.560' AS DateTime)) GO INSERT [dbo].[Page] ([ID], [Name], [Title], [MenuID], [PageLocation], [ServerConfiguration], [ClientConfiguration], [IncludedRoles], [ExcludedRoles], [Description], [Enabled], [CreatedOn]) VALUES (2, N'HomeAdministrator', N'Administrator Dashboard', 2, N'~/Home/HomeAdministrator', NULL, NULL, N'Administrator', NULL, NULL, 1, CAST(N'2019-01-30 10:07:41.573' AS DateTime)) GO INSERT [dbo].[Page] ([ID], [Name], [Title], [MenuID], [PageLocation], [ServerConfiguration], [ClientConfiguration], [IncludedRoles], [ExcludedRoles], [Description], [Enabled], [CreatedOn]) VALUES (3, N'HomeManager', N'Manager Overview', 2, N'~/Home/HomeManager', NULL, NULL, N'Manager', NULL, NULL, 1, CAST(N'2019-01-30 10:07:41.577' AS DateTime)) GO INSERT [dbo].[Page] ([ID], [Name], [Title], [MenuID], [PageLocation], [ServerConfiguration], [ClientConfiguration], [IncludedRoles], [ExcludedRoles], [Description], [Enabled], [CreatedOn]) VALUES (4, N'EngineerEvaluation', N'', 2, N'~/Home/EngineerEvaluation', NULL, NULL, N'Manager', NULL, NULL, 1, CAST(N'2019-01-30 10:07:41.580' AS DateTime)) GO INSERT [dbo].[Page] ([ID], [Name], [Title], [MenuID], [PageLocation], [ServerConfiguration], [ClientConfiguration], [IncludedRoles], [ExcludedRoles], [Description], [Enabled], [CreatedOn]) VALUES (5, N'Help', N'Dashboard', 2, N'~/Home/Help', NULL, NULL, NULL, NULL, NULL, 1, CAST(N'2019-01-30 10:07:41.587' AS DateTime)) GO INSERT [dbo].[Page] ([ID], [Name], [Title], [MenuID], [PageLocation], [ServerConfiguration], [ClientConfiguration], [IncludedRoles], [ExcludedRoles], [Description], [Enabled], [CreatedOn]) VALUES (6, N'Settings.Home', N'Application Settings Management', 3, N'~/Settings/Home', NULL, NULL, NULL, NULL, NULL, 1, CAST(N'2019-01-30 10:07:41.590' AS DateTime)) GO INSERT [dbo].[Page] ([ID], [Name], [Title], [MenuID], [PageLocation], [ServerConfiguration], [ClientConfiguration], [IncludedRoles], [ExcludedRoles], [Description], [Enabled], [CreatedOn]) VALUES (7, N'Security.Users', N'Manage Users', 3, N'~/Security/Users', NULL, NULL, N'Administrator', NULL, NULL, 1, CAST(N'2019-01-30 10:07:41.593' AS DateTime)) GO INSERT [dbo].[Page] ([ID], [Name], [Title], [MenuID], [PageLocation], [ServerConfiguration], [ClientConfiguration], [IncludedRoles], [ExcludedRoles], [Description], [Enabled], [CreatedOn]) VALUES (8, N'Security.Groups', N'Manage Groups', 3, N'~/Security/Groups', NULL, NULL, N'Administrator', NULL, NULL, 1, CAST(N'2019-01-30 10:07:41.597' AS DateTime)) GO INSERT [dbo].[Page] ([ID], [Name], [Title], [MenuID], [PageLocation], [ServerConfiguration], [ClientConfiguration], [IncludedRoles], [ExcludedRoles], [Description], [Enabled], [CreatedOn]) VALUES (9, N'System.Home', N'System Settings Management', 4, N'~/System/Home', NULL, NULL, N'Administrator', NULL, NULL, 1, CAST(N'2019-01-30 10:07:41.600' AS DateTime)) GO INSERT [dbo].[Page] ([ID], [Name], [Title], [MenuID], [PageLocation], [ServerConfiguration], [ClientConfiguration], [IncludedRoles], [ExcludedRoles], [Description], [Enabled], [CreatedOn]) VALUES (10, N'System.Pages', N'Manage System Pages', 4, N'~/System/Pages', NULL, NULL, N'Administrator', NULL, NULL, 1, CAST(N'2019-01-30 10:07:41.603' AS DateTime)) GO INSERT [dbo].[Page] ([ID], [Name], [Title], [MenuID], [PageLocation], [ServerConfiguration], [ClientConfiguration], [IncludedRoles], [ExcludedRoles], [Description], [Enabled], [CreatedOn]) VALUES (11, N'System.Menus', N'Manage System Menus', 4, N'~/System/Menus', NULL, NULL, N'Administrator', NULL, NULL, 1, CAST(N'2019-01-30 10:07:41.607' AS DateTime)) GO INSERT [dbo].[Page] ([ID], [Name], [Title], [MenuID], [PageLocation], [ServerConfiguration], [ClientConfiguration], [IncludedRoles], [ExcludedRoles], [Description], [Enabled], [CreatedOn]) VALUES (12, N'System.MenuItems', N'Page Menu Items', 4, N'', NULL, NULL, N'Administrator', NULL, N'Pop-up only', 1, CAST(N'2019-01-30 10:07:41.610' AS DateTime)) GO INSERT [dbo].[Page] ([ID], [Name], [Title], [MenuID], [PageLocation], [ServerConfiguration], [ClientConfiguration], [IncludedRoles], [ExcludedRoles], [Description], [Enabled], [CreatedOn]) VALUES (13, N'System.ValueListGroups', N'Manage System Value Lists', 4, N'~/System/ValueListGroups', NULL, NULL, N'Administrator', NULL, NULL, 1, CAST(N'2019-01-30 10:07:41.613' AS DateTime)) GO INSERT [dbo].[Page] ([ID], [Name], [Title], [MenuID], [PageLocation], [ServerConfiguration], [ClientConfiguration], [IncludedRoles], [ExcludedRoles], [Description], [Enabled], [CreatedOn]) VALUES (14, N'System.ValueListItems', N'Value List Items', 4, N'', NULL, NULL, N'Administrator', NULL, NULL, 1, CAST(N'2019-01-30 10:07:41.630' AS DateTime)) GO INSERT [dbo].[Page] ([ID], [Name], [Title], [MenuID], [PageLocation], [ServerConfiguration], [ClientConfiguration], [IncludedRoles], [ExcludedRoles], [Description], [Enabled], [CreatedOn]) VALUES (15, N'System.SelectTheme', N'System.SelectTheme', 4, N'~/System/SelectTheme', NULL, NULL, N'Administrator', NULL, NULL, 1, CAST(N'2019-01-30 10:07:41.633' AS DateTime)) GO INSERT [dbo].[Page] ([ID], [Name], [Title], [MenuID], [PageLocation], [ServerConfiguration], [ClientConfiguration], [IncludedRoles], [ExcludedRoles], [Description], [Enabled], [CreatedOn]) VALUES (16, N'Settings.CoreSkills', N'Manage Core Skills', 3, N'~/Settings/CoreSkills', NULL, NULL, N'Administrator,Manager', NULL, NULL, 1, CAST(N'2019-01-30 10:07:41.640' AS DateTime)) GO INSERT [dbo].[Page] ([ID], [Name], [Title], [MenuID], [PageLocation], [ServerConfiguration], [ClientConfiguration], [IncludedRoles], [ExcludedRoles], [Description], [Enabled], [CreatedOn]) VALUES (17, N'Settings.TechnicalSkills', N'Manage Technical Skills', 3, N'~/Settings/TechnicalSkills', NULL, NULL, N'Administrator,Manager', NULL, NULL, 1, CAST(N'2019-01-30 10:07:41.643' AS DateTime)) GO INSERT [dbo].[Page] ([ID], [Name], [Title], [MenuID], [PageLocation], [ServerConfiguration], [ClientConfiguration], [IncludedRoles], [ExcludedRoles], [Description], [Enabled], [CreatedOn]) VALUES (18, N'Settings.ExperienceAreas', N'Manage Experience Areas', 3, N'~/Settings/ExperienceAreas', NULL, NULL, N'Administrator,Manager', NULL, NULL, 1, CAST(N'2019-01-30 10:07:41.647' AS DateTime)) GO INSERT [dbo].[Page] ([ID], [Name], [Title], [MenuID], [PageLocation], [ServerConfiguration], [ClientConfiguration], [IncludedRoles], [ExcludedRoles], [Description], [Enabled], [CreatedOn]) VALUES (19, N'Settings.Engineer', N'Manage Engineers for ', 3, N'~/Settings/Engineer', NULL, NULL, N'Administrator', NULL, NULL, 1, CAST(N'2019-01-30 10:07:41.650' AS DateTime)) GO INSERT [dbo].[Page] ([ID], [Name], [Title], [MenuID], [PageLocation], [ServerConfiguration], [ClientConfiguration], [IncludedRoles], [ExcludedRoles], [Description], [Enabled], [CreatedOn]) VALUES (20, N'Settings.Departments', N'Manage Departments', 3, N'~/Settings/Departments', NULL, NULL, N'Administrator', NULL, NULL, 1, CAST(N'2019-01-30 10:07:41.653' AS DateTime)) GO INSERT [dbo].[Page] ([ID], [Name], [Title], [MenuID], [PageLocation], [ServerConfiguration], [ClientConfiguration], [IncludedRoles], [ExcludedRoles], [Description], [Enabled], [CreatedOn]) VALUES (21, N'EngineerCoreSkills', N'My Core Skills', 2, N'~/Home/EngineerCoreSkills', NULL, NULL, N'Engineer', NULL, NULL, 1, CAST(N'2019-01-30 10:07:41.657' AS DateTime)) GO INSERT [dbo].[Page] ([ID], [Name], [Title], [MenuID], [PageLocation], [ServerConfiguration], [ClientConfiguration], [IncludedRoles], [ExcludedRoles], [Description], [Enabled], [CreatedOn]) VALUES (22, N'EngineerTechnicalSkills', N'My Technical Skills', 2, N'~/Home/EngineerTechnicalSkills', NULL, NULL, N'Engineer', NULL, NULL, 1, CAST(N'2019-01-30 10:07:41.660' AS DateTime)) GO INSERT [dbo].[Page] ([ID], [Name], [Title], [MenuID], [PageLocation], [ServerConfiguration], [ClientConfiguration], [IncludedRoles], [ExcludedRoles], [Description], [Enabled], [CreatedOn]) VALUES (23, N'EngineerExperienceAreas', N'My Breath of Experience', 2, N'~/Home/EngineerExperienceAreas', NULL, NULL, N'Engineer', NULL, NULL, 1, CAST(N'2019-01-30 10:07:41.667' AS DateTime)) GO INSERT [dbo].[Page] ([ID], [Name], [Title], [MenuID], [PageLocation], [ServerConfiguration], [ClientConfiguration], [IncludedRoles], [ExcludedRoles], [Description], [Enabled], [CreatedOn]) VALUES (24, N'Settings.ManagerEngineer', N'Manage Manager''s Engineers', 3, N'~/Settings/ManagerEngineer', NULL, NULL, N'Administrator,DepartmentManager', NULL, NULL, 1, CAST(N'2019-01-30 10:07:41.670' AS DateTime)) GO INSERT [dbo].[Page] ([ID], [Name], [Title], [MenuID], [PageLocation], [ServerConfiguration], [ClientConfiguration], [IncludedRoles], [ExcludedRoles], [Description], [Enabled], [CreatedOn]) VALUES (25, N'Settings.Degrees', N'Manage Degrees', 3, N'~/Settings/Degrees', NULL, NULL, N'Administrator,DepartmentManager', NULL, NULL, 1, CAST(N'2019-01-30 10:07:41.673' AS DateTime)) GO INSERT [dbo].[Page] ([ID], [Name], [Title], [MenuID], [PageLocation], [ServerConfiguration], [ClientConfiguration], [IncludedRoles], [ExcludedRoles], [Description], [Enabled], [CreatedOn]) VALUES (26, N'Settings.Training', N'Manage Training Courses', 3, N'~/Settings/Training', NULL, NULL, N'Administrator,DepartmentManager', NULL, NULL, 1, CAST(N'2019-01-30 10:07:41.677' AS DateTime)) GO INSERT [dbo].[Page] ([ID], [Name], [Title], [MenuID], [PageLocation], [ServerConfiguration], [ClientConfiguration], [IncludedRoles], [ExcludedRoles], [Description], [Enabled], [CreatedOn]) VALUES (27, N'TrainingPlanning', N'Training Planning', 2, N'~/Home/TrainingPlanning', NULL, NULL, N'Administrator,DepartmentManager,Manager', NULL, NULL, 1, CAST(N'2019-01-30 10:07:41.680' AS DateTime)) GO INSERT [dbo].[Page] ([ID], [Name], [Title], [MenuID], [PageLocation], [ServerConfiguration], [ClientConfiguration], [IncludedRoles], [ExcludedRoles], [Description], [Enabled], [CreatedOn]) VALUES (28, N'RotationalPlanning', N'Rotational Planning', 2, N'~/Home/RotationalPlanning', NULL, NULL, N'Administrator,DepartmentManager,Manager', NULL, NULL, 1, CAST(N'2019-01-30 10:07:41.683' AS DateTime)) GO SET IDENTITY_INSERT [dbo].[Page] OFF GO SET IDENTITY_INSERT [dbo].[MenuItem] ON GO INSERT [dbo].[MenuItem] ([ID], [MenuID], [PageID], [Image], [ImageAlt], [Text], [Link], [SortOrder], [Description], [Enabled]) VALUES (1, 1, 1, N'home.png', N'Home', N'My Overview', NULL, 0, NULL, 1) GO INSERT [dbo].[MenuItem] ([ID], [MenuID], [PageID], [Image], [ImageAlt], [Text], [Link], [SortOrder], [Description], [Enabled]) VALUES (2, 1, 3, N'home.png', N'Home', N'My Overview', NULL, 0, NULL, 1) GO INSERT [dbo].[MenuItem] ([ID], [MenuID], [PageID], [Image], [ImageAlt], [Text], [Link], [SortOrder], [Description], [Enabled]) VALUES (3, 1, 2, N'adminDashboard.png', N'Home', N'Admin Dashboard', NULL, 0, NULL, 1) GO INSERT [dbo].[MenuItem] ([ID], [MenuID], [PageID], [Image], [ImageAlt], [Text], [Link], [SortOrder], [Description], [Enabled]) VALUES (4, 1, 5, N'help.png', N'Help', N'Help', NULL, 1010, NULL, 1) GO INSERT [dbo].[MenuItem] ([ID], [MenuID], [PageID], [Image], [ImageAlt], [Text], [Link], [SortOrder], [Description], [Enabled]) VALUES (5, 2, 6, N'settings.png', N'Settings', N'Settings', NULL, 90, N'Goes to Menu 2', 1) GO INSERT [dbo].[MenuItem] ([ID], [MenuID], [PageID], [Image], [ImageAlt], [Text], [Link], [SortOrder], [Description], [Enabled]) VALUES (6, 2, 21, N'../36 pix/CoreSkills.png', N'EngineerCoreSkills', N'My Core Skills', NULL, 30, N'Goes to Menu 2', 1) GO INSERT [dbo].[MenuItem] ([ID], [MenuID], [PageID], [Image], [ImageAlt], [Text], [Link], [SortOrder], [Description], [Enabled]) VALUES (7, 2, 22, N'../36 pix/techSkills.png', N'EngineerTechnSkills', N'My Technical Skills', NULL, 10, N'Goes to Menu 2', 1) GO INSERT [dbo].[MenuItem] ([ID], [MenuID], [PageID], [Image], [ImageAlt], [Text], [Link], [SortOrder], [Description], [Enabled]) VALUES (8, 2, 23, N'../36 pix/Experience.png', N'EngineerTechnSkills', N'My Breadth of Experience', NULL, 20, N'Goes to Menu 2', 1) GO INSERT [dbo].[MenuItem] ([ID], [MenuID], [PageID], [Image], [ImageAlt], [Text], [Link], [SortOrder], [Description], [Enabled]) VALUES (9, 3, 7, N'user.png', N'User', N'Security Users', NULL, 50, N'', 1) GO INSERT [dbo].[MenuItem] ([ID], [MenuID], [PageID], [Image], [ImageAlt], [Text], [Link], [SortOrder], [Description], [Enabled]) VALUES (10, 3, 8, N'userGroup.png', N'Groups', N'Security Groups', NULL, 60, NULL, 1) GO INSERT [dbo].[MenuItem] ([ID], [MenuID], [PageID], [Image], [ImageAlt], [Text], [Link], [SortOrder], [Description], [Enabled]) VALUES (11, 3, 9, N'settingsDetail.png', N'System Settings', N'System Settings', NULL, 100, N'', 1) GO INSERT [dbo].[MenuItem] ([ID], [MenuID], [PageID], [Image], [ImageAlt], [Text], [Link], [SortOrder], [Description], [Enabled]) VALUES (12, 3, 16, N'CoreSkills.png', N'Core Skills', N'Core Skill List', NULL, 20, NULL, 1) GO INSERT [dbo].[MenuItem] ([ID], [MenuID], [PageID], [Image], [ImageAlt], [Text], [Link], [SortOrder], [Description], [Enabled]) VALUES (13, 3, 17, N'techSkills.png', N'Technical Skills', N'Technical Skill List', NULL, 10, NULL, 1) GO INSERT [dbo].[MenuItem] ([ID], [MenuID], [PageID], [Image], [ImageAlt], [Text], [Link], [SortOrder], [Description], [Enabled]) VALUES (14, 3, 18, N'Experience.png', N'Experience Area', N'Experience Area List', NULL, 15, NULL, 1) GO INSERT [dbo].[MenuItem] ([ID], [MenuID], [PageID], [Image], [ImageAlt], [Text], [Link], [SortOrder], [Description], [Enabled]) VALUES (15, 3, 20, N'departments.png', N'Departments', N'Departments', NULL, 22, NULL, 1) GO INSERT [dbo].[MenuItem] ([ID], [MenuID], [PageID], [Image], [ImageAlt], [Text], [Link], [SortOrder], [Description], [Enabled]) VALUES (16, 4, 6, N'settings.png', N'Settings', N'Settings', NULL, 20, N'Goes to Menu 2', 1) GO INSERT [dbo].[MenuItem] ([ID], [MenuID], [PageID], [Image], [ImageAlt], [Text], [Link], [SortOrder], [Description], [Enabled]) VALUES (17, 4, 10, N's.png', N'Pages', N'System Pages', NULL, 30, NULL, 1) GO INSERT [dbo].[MenuItem] ([ID], [MenuID], [PageID], [Image], [ImageAlt], [Text], [Link], [SortOrder], [Description], [Enabled]) VALUES (18, 4, 11, N'm.png', N'Menus', N'System Menus', NULL, 40, NULL, 1) GO INSERT [dbo].[MenuItem] ([ID], [MenuID], [PageID], [Image], [ImageAlt], [Text], [Link], [SortOrder], [Description], [Enabled]) VALUES (19, 4, 13, N'v.png', N'Value Lists', N'System Value Lists', NULL, 50, NULL, 1) GO INSERT [dbo].[MenuItem] ([ID], [MenuID], [PageID], [Image], [ImageAlt], [Text], [Link], [SortOrder], [Description], [Enabled]) VALUES (20, 4, 15, N't.png', NULL, N'System Select Theme', NULL, 60, NULL, 1) GO INSERT [dbo].[MenuItem] ([ID], [MenuID], [PageID], [Image], [ImageAlt], [Text], [Link], [SortOrder], [Description], [Enabled]) VALUES (21, 3, 25, N'degree.png', NULL, N'Degrees', NULL, 23, NULL, 1) GO INSERT [dbo].[MenuItem] ([ID], [MenuID], [PageID], [Image], [ImageAlt], [Text], [Link], [SortOrder], [Description], [Enabled]) VALUES (22, 3, 26, N'training.png', NULL, N'Training Courses', NULL, 24, NULL, 1) GO INSERT [dbo].[MenuItem] ([ID], [MenuID], [PageID], [Image], [ImageAlt], [Text], [Link], [SortOrder], [Description], [Enabled]) VALUES (23, 2, 27, N'trainingPlanning.png', NULL, N'Training Planning', NULL, 40, NULL, 1) GO INSERT [dbo].[MenuItem] ([ID], [MenuID], [PageID], [Image], [ImageAlt], [Text], [Link], [SortOrder], [Description], [Enabled]) VALUES (24, 2, 28, N'IDPupdate.png', NULL, N'Rotational Planning', NULL, 41, NULL, 1) GO SET IDENTITY_INSERT [dbo].[MenuItem] OFF GO INSERT [dbo].[SecurityGroup] ([ID], [Name], [Description], [CreatedOn], [CreatedBy], [UpdatedOn], [UpdatedBy]) VALUES (N'6d9c98ca-d187-41fa-bcf6-2bd9fcf26914', N'S-1-5-32-545', N'All Windows authenticated users', CAST(N'2019-01-30 10:05:10.197' AS DateTime), N'dbo', CAST(N'2019-01-30 10:05:10.197' AS DateTime), N'dbo') GO SET IDENTITY_INSERT [dbo].[Settings] ON GO INSERT [dbo].[Settings] ([ID], [Scope], [Name], [Value], [ApplicationInstance], [Roles]) VALUES (1, N'layout.setting', N'menuImagePath', N'~/Images/Menu/', 0, N'Administrator, Manager') GO INSERT [dbo].[Settings] ([ID], [Scope], [Name], [Value], [ApplicationInstance], [Roles]) VALUES (2, N'page.default', N'pageImagePath', N'~/Images/{pageName}', 0, N'Administrator, Manager') GO INSERT [dbo].[Settings] ([ID], [Scope], [Name], [Value], [ApplicationInstance], [Roles]) VALUES (3, N'app.setting', N'applicationName', N'TechDev', 0, N'Administrator, Manager') GO INSERT [dbo].[Settings] ([ID], [Scope], [Name], [Value], [ApplicationInstance], [Roles]) VALUES (4, N'app.setting', N'applicationDescription', N'open Security Patch Management', 0, N'Administrator, Manager') GO INSERT [dbo].[Settings] ([ID], [Scope], [Name], [Value], [ApplicationInstance], [Roles]) VALUES (5, N'app.setting', N'applicationKeywords', N'open source, utility, software, patch, management', 0, N'Administrator, Manager') GO INSERT [dbo].[Settings] ([ID], [Scope], [Name], [Value], [ApplicationInstance], [Roles]) VALUES (6, N'app.setting', N'bootstrapTheme', N'~/Content/bootstrap-theme.css', 0, N'Administrator, Manager') GO INSERT [dbo].[Settings] ([ID], [Scope], [Name], [Value], [ApplicationInstance], [Roles]) VALUES (7, N'layout.setting', N'showCopyright', N'true', 0, N'Administrator, Manager') GO INSERT [dbo].[Settings] ([ID], [Scope], [Name], [Value], [ApplicationInstance], [Roles]) VALUES (8, N'layout.setting', N'copyrightText', N'Copyright © 2016, Grid Protection Alliance', 0, N'Administrator, Manager') GO INSERT [dbo].[Settings] ([ID], [Scope], [Name], [Value], [ApplicationInstance], [Roles]) VALUES (9, N'layout.setting', N'copyrightUrl', N'~/Main/Contact', 0, N'Administrator, Manager') GO SET IDENTITY_INSERT [dbo].[Settings] OFF GO SET IDENTITY_INSERT [dbo].[ValueList] ON GO INSERT [dbo].[ValueList] ([ID], [GroupID], [Key], [Text], [AltText1], [AltText2], [Abbreviation], [Value], [Flag], [Description], [SortOrder], [IsDefault], [Hidden], [Enabled], [CreatedOn]) VALUES (1, 1, 1, N'Text', N'TXT', NULL, NULL, NULL, 0, NULL, 10, 0, 0, 1, CAST(N'2019-01-30 10:08:16.323' AS DateTime)) GO INSERT [dbo].[ValueList] ([ID], [GroupID], [Key], [Text], [AltText1], [AltText2], [Abbreviation], [Value], [Flag], [Description], [SortOrder], [IsDefault], [Hidden], [Enabled], [CreatedOn]) VALUES (2, 1, 2, N'PDF', N'PDF', NULL, NULL, NULL, 0, NULL, 20, 1, 0, 1, CAST(N'2019-01-30 10:08:16.333' AS DateTime)) GO INSERT [dbo].[ValueList] ([ID], [GroupID], [Key], [Text], [AltText1], [AltText2], [Abbreviation], [Value], [Flag], [Description], [SortOrder], [IsDefault], [Hidden], [Enabled], [CreatedOn]) VALUES (3, 1, 3, N'html', N'HTM', NULL, NULL, NULL, 0, NULL, 50, 0, 0, 1, CAST(N'2019-01-30 10:08:16.340' AS DateTime)) GO INSERT [dbo].[ValueList] ([ID], [GroupID], [Key], [Text], [AltText1], [AltText2], [Abbreviation], [Value], [Flag], [Description], [SortOrder], [IsDefault], [Hidden], [Enabled], [CreatedOn]) VALUES (4, 1, 4, N'Word', N'DOC', NULL, NULL, NULL, 0, NULL, 30, 0, 0, 1, CAST(N'2019-01-30 10:08:16.347' AS DateTime)) GO INSERT [dbo].[ValueList] ([ID], [GroupID], [Key], [Text], [AltText1], [AltText2], [Abbreviation], [Value], [Flag], [Description], [SortOrder], [IsDefault], [Hidden], [Enabled], [CreatedOn]) VALUES (5, 1, 5, N'RTF', N'RTF', NULL, NULL, NULL, 0, NULL, 40, 0, 0, 1, CAST(N'2019-01-30 10:08:16.350' AS DateTime)) GO INSERT [dbo].[ValueList] ([ID], [GroupID], [Key], [Text], [AltText1], [AltText2], [Abbreviation], [Value], [Flag], [Description], [SortOrder], [IsDefault], [Hidden], [Enabled], [CreatedOn]) VALUES (6, 1, 6, N'Other', N'*', NULL, NULL, NULL, 0, NULL, 60, 0, 0, 1, CAST(N'2019-01-30 10:08:16.357' AS DateTime)) GO INSERT [dbo].[ValueList] ([ID], [GroupID], [Key], [Text], [AltText1], [AltText2], [Abbreviation], [Value], [Flag], [Description], [SortOrder], [IsDefault], [Hidden], [Enabled], [CreatedOn]) VALUES (7, 2, 1, N'Engineer I', N'#e6194B', NULL, NULL, 1, 0, NULL, 1, 0, 0, 1, CAST(N'2019-01-30 10:08:16.363' AS DateTime)) GO INSERT [dbo].[ValueList] ([ID], [GroupID], [Key], [Text], [AltText1], [AltText2], [Abbreviation], [Value], [Flag], [Description], [SortOrder], [IsDefault], [Hidden], [Enabled], [CreatedOn]) VALUES (8, 2, 2, N'Engineer II', N'#3cb44b', NULL, NULL, 2, 0, NULL, 2, 0, 0, 1, CAST(N'2019-01-30 10:08:16.367' AS DateTime)) GO INSERT [dbo].[ValueList] ([ID], [GroupID], [Key], [Text], [AltText1], [AltText2], [Abbreviation], [Value], [Flag], [Description], [SortOrder], [IsDefault], [Hidden], [Enabled], [CreatedOn]) VALUES (9, 2, 3, N'Engineer III', N'#ffe119', NULL, NULL, 3, 0, NULL, 3, 0, 0, 1, CAST(N'2019-01-30 10:08:16.370' AS DateTime)) GO INSERT [dbo].[ValueList] ([ID], [GroupID], [Key], [Text], [AltText1], [AltText2], [Abbreviation], [Value], [Flag], [Description], [SortOrder], [IsDefault], [Hidden], [Enabled], [CreatedOn]) VALUES (10, 2, 4, N'Consulting Engineer', N'#4363d8', NULL, NULL, 4, 0, NULL, 4, 0, 0, 1, CAST(N'2019-01-30 10:08:16.373' AS DateTime)) GO INSERT [dbo].[ValueList] ([ID], [GroupID], [Key], [Text], [AltText1], [AltText2], [Abbreviation], [Value], [Flag], [Description], [SortOrder], [IsDefault], [Hidden], [Enabled], [CreatedOn]) VALUES (11, 2, 5, N'Principal Engineer', N'#f58231', NULL, NULL, 5, 0, NULL, 5, 0, 0, 1, CAST(N'2019-01-30 10:08:16.380' AS DateTime)) GO INSERT [dbo].[ValueList] ([ID], [GroupID], [Key], [Text], [AltText1], [AltText2], [Abbreviation], [Value], [Flag], [Description], [SortOrder], [IsDefault], [Hidden], [Enabled], [CreatedOn]) VALUES (12, 3, 1, N'Multiplier', N'1.10', NULL, NULL, 0, 0, N'Value multiplied by composite score if engineer has a PE', 0, 0, 0, 1, CAST(N'2019-01-30 10:08:16.383' AS DateTime)) GO INSERT [dbo].[ValueList] ([ID], [GroupID], [Key], [Text], [AltText1], [AltText2], [Abbreviation], [Value], [Flag], [Description], [SortOrder], [IsDefault], [Hidden], [Enabled], [CreatedOn]) VALUES (13, 4, 9, N'High', NULL, NULL, NULL, 9, 0, NULL, 0, 0, 0, 1, CAST(N'2019-01-30 10:08:16.387' AS DateTime)) GO INSERT [dbo].[ValueList] ([ID], [GroupID], [Key], [Text], [AltText1], [AltText2], [Abbreviation], [Value], [Flag], [Description], [SortOrder], [IsDefault], [Hidden], [Enabled], [CreatedOn]) VALUES (14, 4, 3, N'Medium', NULL, NULL, NULL, 3, 0, NULL, 1, 0, 0, 1, CAST(N'2019-01-30 10:08:16.390' AS DateTime)) GO INSERT [dbo].[ValueList] ([ID], [GroupID], [Key], [Text], [AltText1], [AltText2], [Abbreviation], [Value], [Flag], [Description], [SortOrder], [IsDefault], [Hidden], [Enabled], [CreatedOn]) VALUES (15, 4, 1, N'Low', NULL, NULL, NULL, 1, 0, NULL, 2, 0, 0, 1, CAST(N'2019-01-30 10:08:16.393' AS DateTime)) GO INSERT [dbo].[ValueList] ([ID], [GroupID], [Key], [Text], [AltText1], [AltText2], [Abbreviation], [Value], [Flag], [Description], [SortOrder], [IsDefault], [Hidden], [Enabled], [CreatedOn]) VALUES (16, 5, 10, N'Expert', NULL, NULL, NULL, 10, 0, NULL, 0, 0, 0, 1, CAST(N'2019-01-30 10:08:16.410' AS DateTime)) GO INSERT [dbo].[ValueList] ([ID], [GroupID], [Key], [Text], [AltText1], [AltText2], [Abbreviation], [Value], [Flag], [Description], [SortOrder], [IsDefault], [Hidden], [Enabled], [CreatedOn]) VALUES (17, 5, 5, N'Competent', NULL, NULL, NULL, 5, 0, NULL, 1, 0, 0, 1, CAST(N'2019-01-30 10:08:16.413' AS DateTime)) GO INSERT [dbo].[ValueList] ([ID], [GroupID], [Key], [Text], [AltText1], [AltText2], [Abbreviation], [Value], [Flag], [Description], [SortOrder], [IsDefault], [Hidden], [Enabled], [CreatedOn]) VALUES (18, 5, 3, N'Developing', NULL, NULL, NULL, 3, 0, NULL, 2, 0, 0, 1, CAST(N'2019-01-30 10:08:16.417' AS DateTime)) GO INSERT [dbo].[ValueList] ([ID], [GroupID], [Key], [Text], [AltText1], [AltText2], [Abbreviation], [Value], [Flag], [Description], [SortOrder], [IsDefault], [Hidden], [Enabled], [CreatedOn]) VALUES (19, 5, 0, N'Not Exposed', NULL, NULL, NULL, 0, 0, NULL, 4, 0, 0, 1, CAST(N'2019-01-30 10:08:16.420' AS DateTime)) GO INSERT [dbo].[ValueList] ([ID], [GroupID], [Key], [Text], [AltText1], [AltText2], [Abbreviation], [Value], [Flag], [Description], [SortOrder], [IsDefault], [Hidden], [Enabled], [CreatedOn]) VALUES (20, 5, -1, N'Not Applicable', NULL, NULL, NULL, -1, 0, NULL, 5, 0, 0, 1, CAST(N'2019-01-30 10:08:16.427' AS DateTime)) GO INSERT [dbo].[ValueList] ([ID], [GroupID], [Key], [Text], [AltText1], [AltText2], [Abbreviation], [Value], [Flag], [Description], [SortOrder], [IsDefault], [Hidden], [Enabled], [CreatedOn]) VALUES (21, 6, 3, N'External Equivalent/Completed', NULL, NULL, NULL, 3, 0, NULL, 0, 0, 0, 1, CAST(N'2019-01-30 10:08:16.433' AS DateTime)) GO INSERT [dbo].[ValueList] ([ID], [GroupID], [Key], [Text], [AltText1], [AltText2], [Abbreviation], [Value], [Flag], [Description], [SortOrder], [IsDefault], [Hidden], [Enabled], [CreatedOn]) VALUES (22, 6, 1, N'Rotation-In-Progress', NULL, NULL, NULL, 1, 0, NULL, 1, 0, 0, 1, CAST(N'2019-01-30 10:08:16.437' AS DateTime)) GO INSERT [dbo].[ValueList] ([ID], [GroupID], [Key], [Text], [AltText1], [AltText2], [Abbreviation], [Value], [Flag], [Description], [SortOrder], [IsDefault], [Hidden], [Enabled], [CreatedOn]) VALUES (24, 6, 0, N'Potential', NULL, NULL, NULL, 0, 0, NULL, 2, 0, 0, 1, CAST(N'2019-01-30 10:08:16.443' AS DateTime)) GO INSERT [dbo].[ValueList] ([ID], [GroupID], [Key], [Text], [AltText1], [AltText2], [Abbreviation], [Value], [Flag], [Description], [SortOrder], [IsDefault], [Hidden], [Enabled], [CreatedOn]) VALUES (25, 6, -1, N'Not Applicable', NULL, NULL, NULL, -1, 0, NULL, 3, 0, 0, 1, CAST(N'2019-01-30 10:08:16.450' AS DateTime)) GO INSERT [dbo].[ValueList] ([ID], [GroupID], [Key], [Text], [AltText1], [AltText2], [Abbreviation], [Value], [Flag], [Description], [SortOrder], [IsDefault], [Hidden], [Enabled], [CreatedOn]) VALUES (26, 6, -2, N'Up-Next', NULL, NULL, NULL, -2, 0, NULL, 4, 0, 0, 1, CAST(N'2019-01-30 10:08:16.453' AS DateTime)) GO INSERT [dbo].[ValueList] ([ID], [GroupID], [Key], [Text], [AltText1], [AltText2], [Abbreviation], [Value], [Flag], [Description], [SortOrder], [IsDefault], [Hidden], [Enabled], [CreatedOn]) VALUES (27, 5, 1, N'Aware', NULL, NULL, NULL, 1, 0, NULL, 3, 0, 0, 1, CAST(N'2019-01-30 19:21:13.807' AS DateTime)) GO INSERT [dbo].[ValueList] ([ID], [GroupID], [Key], [Text], [AltText1], [AltText2], [Abbreviation], [Value], [Flag], [Description], [SortOrder], [IsDefault], [Hidden], [Enabled], [CreatedOn]) VALUES (28, 4, -3, N'Not-Rated', NULL, NULL, NULL, -3, 0, NULL, 3, 0, 0, 1, CAST(N'2019-02-05 08:56:47.573' AS DateTime)) GO INSERT [dbo].[ValueList] ([ID], [GroupID], [Key], [Text], [AltText1], [AltText2], [Abbreviation], [Value], [Flag], [Description], [SortOrder], [IsDefault], [Hidden], [Enabled], [CreatedOn]) VALUES (29, 5, -3, N'Not-Rated', NULL, NULL, NULL, -3, 0, NULL, 6, 0, 0, 1, CAST(N'2019-02-05 08:56:47.593' AS DateTime)) GO INSERT [dbo].[ValueList] ([ID], [GroupID], [Key], [Text], [AltText1], [AltText2], [Abbreviation], [Value], [Flag], [Description], [SortOrder], [IsDefault], [Hidden], [Enabled], [CreatedOn]) VALUES (30, 6, -3, N'Not-Rated', NULL, NULL, NULL, -3, 0, NULL, 5, 0, 0, 1, CAST(N'2019-02-05 08:56:47.600' AS DateTime)) GO SET IDENTITY_INSERT [dbo].[ValueList] OFF GO SET IDENTITY_INSERT [dbo].[ValueListGroup] ON GO INSERT [dbo].[ValueListGroup] ([ID], [Name], [Description], [Enabled], [CreatedOn]) VALUES (1, N'fileType', N'The allowed file types (extensions) for imported files.', 1, CAST(N'2019-01-30 10:08:05.753' AS DateTime)) GO INSERT [dbo].[ValueListGroup] ([ID], [Name], [Description], [Enabled], [CreatedOn]) VALUES (2, N'engineerGrade', N'Job grade for engineers', 1, CAST(N'2019-01-30 10:08:05.760' AS DateTime)) GO INSERT [dbo].[ValueListGroup] ([ID], [Name], [Description], [Enabled], [CreatedOn]) VALUES (3, N'Settings', N'System Wide Settings', 1, CAST(N'2019-01-30 10:08:05.760' AS DateTime)) GO INSERT [dbo].[ValueListGroup] ([ID], [Name], [Description], [Enabled], [CreatedOn]) VALUES (4, N'coreScores', N'Enum for core scores.', 1, CAST(N'2019-01-30 10:08:05.760' AS DateTime)) GO INSERT [dbo].[ValueListGroup] ([ID], [Name], [Description], [Enabled], [CreatedOn]) VALUES (5, N'techScores', N'Enum for technical skill scores.', 1, CAST(N'2019-01-30 10:08:05.763' AS DateTime)) GO INSERT [dbo].[ValueListGroup] ([ID], [Name], [Description], [Enabled], [CreatedOn]) VALUES (6, N'expScores', N'Enum for experience area scores.', 1, CAST(N'2019-01-30 10:08:05.763' AS DateTime)) GO SET IDENTITY_INSERT [dbo].[ValueListGroup] OFF GO /****** Object: Index [UC_EngineerID_TrainingID] Script Date: 6/5/2020 3:49:38 PM ******/ ALTER TABLE [dbo].[EngineerTraining] ADD CONSTRAINT [UC_EngineerID_TrainingID] UNIQUE NONCLUSTERED ( [EngineerID] ASC, [TrainingID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] GO /****** Object: Index [UC_TrainingID_DegreeID] Script Date: 6/5/2020 3:49:38 PM ******/ ALTER TABLE [dbo].[TrainingDegree] ADD CONSTRAINT [UC_TrainingID_DegreeID] UNIQUE NONCLUSTERED ( [TrainingID] ASC, [DegreeID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] GO ALTER TABLE [dbo].[AccessLog] ADD DEFAULT (getdate()) FOR [CreatedOn] GO ALTER TABLE [dbo].[ApplicationRole] ADD DEFAULT (newid()) FOR [ID] GO ALTER TABLE [dbo].[ApplicationRole] ADD DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [NodeID] GO ALTER TABLE [dbo].[ApplicationRole] ADD DEFAULT (getdate()) FOR [CreatedOn] GO ALTER TABLE [dbo].[ApplicationRole] ADD DEFAULT (user_name()) FOR [CreatedBy] GO ALTER TABLE [dbo].[ApplicationRole] ADD DEFAULT (getdate()) FOR [UpdatedOn] GO ALTER TABLE [dbo].[ApplicationRole] ADD DEFAULT (user_name()) FOR [UpdatedBy] GO ALTER TABLE [dbo].[Document] ADD DEFAULT (getdate()) FOR [CreatedOn] GO ALTER TABLE [dbo].[EngineerInformation] ADD DEFAULT ((0)) FOR [HasPE] GO ALTER TABLE [dbo].[EngineerInformation] ADD DEFAULT ((0)) FOR [Dormant] GO ALTER TABLE [dbo].[ErrorLog] ADD DEFAULT (getdate()) FOR [CreatedOn] GO ALTER TABLE [dbo].[EvaluationType] ADD DEFAULT (getdate()) FOR [CreatedOn] GO ALTER TABLE [dbo].[EvaluationType] ADD DEFAULT (user_name()) FOR [CreatedBy] GO ALTER TABLE [dbo].[Factor] ADD DEFAULT (getdate()) FOR [CreatedOn] GO ALTER TABLE [dbo].[Factor] ADD DEFAULT (user_name()) FOR [CreatedBy] GO ALTER TABLE [dbo].[FactorEvidence] ADD DEFAULT (getdate()) FOR [EndDate] GO ALTER TABLE [dbo].[FactorEvidence] ADD DEFAULT (getdate()) FOR [CreatedOn] GO ALTER TABLE [dbo].[FactorEvidence] ADD DEFAULT (user_name()) FOR [CreatedBy] GO ALTER TABLE [dbo].[Menu] ADD DEFAULT (getdate()) FOR [CreatedOn] GO ALTER TABLE [dbo].[Node] ADD DEFAULT ((1)) FOR [Enabled] GO ALTER TABLE [dbo].[Node] ADD DEFAULT (getdate()) FOR [CreatedOn] GO ALTER TABLE [dbo].[Node] ADD DEFAULT (user_name()) FOR [CreatedBy] GO ALTER TABLE [dbo].[Node] ADD DEFAULT (getdate()) FOR [UpdatedOn] GO ALTER TABLE [dbo].[Node] ADD DEFAULT (user_name()) FOR [UpdatedBy] GO ALTER TABLE [dbo].[Page] ADD DEFAULT (getdate()) FOR [CreatedOn] GO ALTER TABLE [dbo].[Score] ADD DEFAULT (getdate()) FOR [CreatedOn] GO ALTER TABLE [dbo].[Score] ADD DEFAULT (user_name()) FOR [CreatedBy] GO ALTER TABLE [dbo].[SecurityGroup] ADD DEFAULT (newid()) FOR [ID] GO ALTER TABLE [dbo].[SecurityGroup] ADD DEFAULT (getdate()) FOR [CreatedOn] GO ALTER TABLE [dbo].[SecurityGroup] ADD DEFAULT (user_name()) FOR [CreatedBy] GO ALTER TABLE [dbo].[SecurityGroup] ADD DEFAULT (getdate()) FOR [UpdatedOn] GO ALTER TABLE [dbo].[SecurityGroup] ADD DEFAULT (user_name()) FOR [UpdatedBy] GO ALTER TABLE [dbo].[UserAccount] ADD DEFAULT (newid()) FOR [ID] GO ALTER TABLE [dbo].[UserAccount] ADD DEFAULT (user_name()) FOR [CreatedOn] GO ALTER TABLE [dbo].[UserAccount] ADD DEFAULT (getdate()) FOR [CreatedBy] GO ALTER TABLE [dbo].[UserAccount] ADD DEFAULT (user_name()) FOR [UpdatedOn] GO ALTER TABLE [dbo].[UserAccount] ADD DEFAULT (getdate()) FOR [UpdatedBy] GO ALTER TABLE [dbo].[ValueList] ADD DEFAULT (getdate()) FOR [CreatedOn] GO ALTER TABLE [dbo].[ValueListGroup] ADD DEFAULT (getdate()) FOR [CreatedOn] GO ALTER TABLE [dbo].[ApplicationRole] WITH CHECK ADD FOREIGN KEY([NodeID]) REFERENCES [dbo].[Node] ([ID]) GO ALTER TABLE [dbo].[ApplicationRoleSecurityGroup] WITH CHECK ADD FOREIGN KEY([ApplicationRoleID]) REFERENCES [dbo].[ApplicationRole] ([ID]) GO ALTER TABLE [dbo].[ApplicationRoleSecurityGroup] WITH CHECK ADD FOREIGN KEY([SecurityGroupID]) REFERENCES [dbo].[SecurityGroup] ([ID]) GO ALTER TABLE [dbo].[ApplicationRoleUserAccount] WITH CHECK ADD FOREIGN KEY([ApplicationRoleID]) REFERENCES [dbo].[ApplicationRole] ([ID]) GO ALTER TABLE [dbo].[ApplicationRoleUserAccount] WITH CHECK ADD FOREIGN KEY([UserAccountID]) REFERENCES [dbo].[UserAccount] ([ID]) GO ALTER TABLE [dbo].[Department] WITH CHECK ADD FOREIGN KEY([ManagerID]) REFERENCES [dbo].[UserAccount] ([ID]) GO ALTER TABLE [dbo].[Document] WITH CHECK ADD FOREIGN KEY([CreatedByID]) REFERENCES [dbo].[UserAccount] ([ID]) GO ALTER TABLE [dbo].[EngineerInformation] WITH CHECK ADD FOREIGN KEY([DegreeID]) REFERENCES [dbo].[Degree] ([ID]) GO ALTER TABLE [dbo].[EngineerInformation] WITH CHECK ADD FOREIGN KEY([EngineerID]) REFERENCES [dbo].[UserAccount] ([ID]) GO ALTER TABLE [dbo].[EngineerInformation] WITH CHECK ADD FOREIGN KEY([JobTitleID]) REFERENCES [dbo].[ValueList] ([ID]) GO ALTER TABLE [dbo].[EngineerTraining] WITH CHECK ADD FOREIGN KEY([EngineerID]) REFERENCES [dbo].[UserAccount] ([ID]) GO ALTER TABLE [dbo].[EngineerTraining] WITH CHECK ADD FOREIGN KEY([TrainingID]) REFERENCES [dbo].[Training] ([ID]) GO ALTER TABLE [dbo].[Factor] WITH CHECK ADD FOREIGN KEY([EvaluationTypeID]) REFERENCES [dbo].[EvaluationType] ([ID]) GO ALTER TABLE [dbo].[FactorEvidence] WITH CHECK ADD FOREIGN KEY([FactorID]) REFERENCES [dbo].[Factor] ([ID]) GO ALTER TABLE [dbo].[FactorEvidence] WITH CHECK ADD FOREIGN KEY([UserAccountID]) REFERENCES [dbo].[UserAccount] ([ID]) GO ALTER TABLE [dbo].[FactorEvidenceDocument] WITH CHECK ADD FOREIGN KEY([DocumentID]) REFERENCES [dbo].[Document] ([ID]) GO ALTER TABLE [dbo].[FactorEvidenceDocument] WITH CHECK ADD FOREIGN KEY([FactorEvidenceID]) REFERENCES [dbo].[FactorEvidence] ([ID]) GO ALTER TABLE [dbo].[ManagerEngineer] WITH CHECK ADD FOREIGN KEY([EngineerID]) REFERENCES [dbo].[UserAccount] ([ID]) GO ALTER TABLE [dbo].[ManagerEngineer] WITH CHECK ADD FOREIGN KEY([ManagerID]) REFERENCES [dbo].[UserAccount] ([ID]) GO ALTER TABLE [dbo].[MenuItem] WITH CHECK ADD FOREIGN KEY([MenuID]) REFERENCES [dbo].[Menu] ([ID]) GO ALTER TABLE [dbo].[MenuItem] WITH CHECK ADD FOREIGN KEY([PageID]) REFERENCES [dbo].[Page] ([ID]) GO ALTER TABLE [dbo].[Page] WITH CHECK ADD FOREIGN KEY([MenuID]) REFERENCES [dbo].[Menu] ([ID]) GO ALTER TABLE [dbo].[Score] WITH CHECK ADD FOREIGN KEY([FactorID]) REFERENCES [dbo].[Factor] ([ID]) GO ALTER TABLE [dbo].[Score] WITH CHECK ADD FOREIGN KEY([UserAccountID]) REFERENCES [dbo].[UserAccount] ([ID]) GO ALTER TABLE [dbo].[SecurityGroupUserAccount] WITH CHECK ADD FOREIGN KEY([SecurityGroupID]) REFERENCES [dbo].[SecurityGroup] ([ID]) GO ALTER TABLE [dbo].[SecurityGroupUserAccount] WITH CHECK ADD FOREIGN KEY([UserAccountID]) REFERENCES [dbo].[UserAccount] ([ID]) GO ALTER TABLE [dbo].[TrainingDegree] WITH CHECK ADD FOREIGN KEY([DegreeID]) REFERENCES [dbo].[Degree] ([ID]) GO ALTER TABLE [dbo].[TrainingDegree] WITH CHECK ADD FOREIGN KEY([TrainingID]) REFERENCES [dbo].[Training] ([ID]) GO ALTER TABLE [dbo].[UserAccount] WITH CHECK ADD FOREIGN KEY([DefaultNodeID]) REFERENCES [dbo].[Node] ([ID]) GO ALTER TABLE [dbo].[ValueList] WITH CHECK ADD FOREIGN KEY([GroupID]) REFERENCES [dbo].[ValueListGroup] ([ID]) GO