-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
284 changed files
with
22,207 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<configuration> | ||
<configSections> | ||
|
||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> | ||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections> | ||
<entityFramework> | ||
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" /> | ||
<providers> | ||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> | ||
</providers> | ||
</entityFramework> | ||
<connectionStrings> | ||
<add name="KonfDBEntities" connectionString="metadata=res://*/Database.EntityFramework.KonfDBModel.csdl|res://*/Database.EntityFramework.KonfDBModel.ssdl|res://*/Database.EntityFramework.KonfDBModel.msl;provider=System.Data.SqlClient;provider connection string="data source=.;initial catalog=konf;integrated security=True;multipleactiveresultsets=True;application name=EntityFramework"" providerName="System.Data.EntityClient" /> | ||
</connectionStrings> | ||
</configuration> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
CREATE TABLE [Account].[Membership] ( | ||
[UserId] INT NOT NULL, | ||
[CreateDate] DATETIME NULL, | ||
[ConfirmationToken] NVARCHAR (128) NULL, | ||
[IsConfirmed] BIT DEFAULT ((0)) NULL, | ||
[LastPasswordFailureDate] DATETIME NULL, | ||
[PasswordFailuresSinceLastSuccess] INT DEFAULT ((0)) NOT NULL, | ||
[Password] NVARCHAR (300) NOT NULL, | ||
[PasswordChangedDate] DATETIME NULL, | ||
[PasswordSalt] NVARCHAR (128) NOT NULL, | ||
[PasswordVerificationToken] NVARCHAR (128) NULL, | ||
[PasswordVerificationTokenExpirationDate] DATETIME NULL, | ||
PRIMARY KEY CLUSTERED ([UserId] ASC), | ||
CONSTRAINT [fk_UserIdMembership] FOREIGN KEY ([UserId]) REFERENCES [Account].[Users] ([UserId]) | ||
); | ||
|
7 changes: 7 additions & 0 deletions
7
KonfDB.Engine/Assets/Scripts/MsSql/Account/OAuthMembership.sql
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CREATE TABLE [Account].[OAuthMembership] ( | ||
[Provider] NVARCHAR (30) NOT NULL, | ||
[ProviderUserId] NVARCHAR (100) NOT NULL, | ||
[UserId] INT NOT NULL, | ||
PRIMARY KEY CLUSTERED ([Provider] ASC, [ProviderUserId] ASC) | ||
); | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CREATE TABLE [Account].[Roles] ( | ||
[RoleId] INT IDENTITY (1, 1) NOT NULL, | ||
[RoleName] NVARCHAR (256) NOT NULL, | ||
PRIMARY KEY CLUSTERED ([RoleId] ASC), | ||
UNIQUE NONCLUSTERED ([RoleName] ASC) | ||
); | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CREATE TABLE [Account].[Users] ( | ||
[UserId] INT IDENTITY (0, 1) NOT NULL, | ||
[UserName] NVARCHAR (56) NOT NULL, | ||
PRIMARY KEY CLUSTERED ([UserId] ASC), | ||
UNIQUE NONCLUSTERED ([UserName] ASC) | ||
); | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
CREATE TABLE [Config].[Application] ( | ||
[ApplicationId] BIGINT IDENTITY (1, 1) NOT NULL, | ||
[SuiteId] BIGINT NOT NULL, | ||
[ApplicationName] NVARCHAR (60) NOT NULL, | ||
[Description] NVARCHAR (MAX) NULL, | ||
[IsActive] BIT CONSTRAINT [DF_Applications_IsActive] DEFAULT ((1)) NOT NULL, | ||
CONSTRAINT [PK_Applications] PRIMARY KEY CLUSTERED ([ApplicationId] ASC), | ||
CONSTRAINT [FK_Application_Suite] FOREIGN KEY ([SuiteId]) REFERENCES [Config].[Suite] ([SuiteId]) | ||
); | ||
|
||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
CREATE TABLE [Config].[Audit] ( | ||
[AuditId] BIGINT IDENTITY (1, 1) NOT NULL, | ||
[AuditAreaId] INT NOT NULL, | ||
[AuditIdentity] NVARCHAR(100) NOT NULL, | ||
[Message] NVARCHAR (MAX) NOT NULL, | ||
[UserId] INT NOT NULL, | ||
[ActionAtUtc] DATETIME NOT NULL, | ||
[Reason] NVARCHAR(20) NOT NULL, | ||
[Metadata1] NVARCHAR (50) NULL, | ||
[Metadata2] NVARCHAR (50) NULL, | ||
CONSTRAINT [PK_Audit] PRIMARY KEY CLUSTERED ([AuditId] ASC), | ||
CONSTRAINT [FK_Audit_AuditArea] FOREIGN KEY ([AuditAreaId]) REFERENCES [Config].[AuditArea] ([AuditAreaId]) | ||
); | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
CREATE TABLE [Config].[AuditArea] ( | ||
[AuditAreaId] INT, | ||
[AuditAreaName] NVARCHAR (50) NOT NULL, | ||
CONSTRAINT [PK_AuditArea] PRIMARY KEY CLUSTERED ([AuditAreaId] ASC) | ||
); | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
CREATE TABLE [Config].[Category] ( | ||
[CategoryId] BIGINT IDENTITY (1, 1) NOT NULL, | ||
[ApplicationId] BIGINT NOT NULL, | ||
[CategoryName] NVARCHAR (60) NOT NULL, | ||
[IsActive] BIT CONSTRAINT [DF_Category_IsActive] DEFAULT ((1)) NOT NULL, | ||
[Description] NVARCHAR (100) NULL, | ||
CONSTRAINT [PK_Category] PRIMARY KEY CLUSTERED ([CategoryId] ASC), | ||
CONSTRAINT [FK_Category_Application] FOREIGN KEY ([ApplicationId]) REFERENCES [Config].[Application] ([ApplicationId]) | ||
); | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
CREATE TABLE [Config].[Environment] ( | ||
[EnvironmentId] BIGINT IDENTITY(1,1) NOT NULL, | ||
[EnvironmentName] NVARCHAR (50) NOT NULL, | ||
[EnvironmentTypeId] INT NOT NULL, | ||
[SuiteId] BIGINT NOT NULL, | ||
[IsActive] BIT CONSTRAINT [DF_Environment_IsActive] DEFAULT ((1)) NOT NULL, | ||
CONSTRAINT [PK_Environment] PRIMARY KEY CLUSTERED ([EnvironmentId] ASC), | ||
CONSTRAINT [FK_Environment_EnvironmentType] FOREIGN KEY ([EnvironmentTypeId]) REFERENCES [Config].[EnvironmentType] ([EnvironmentTypeId]), | ||
CONSTRAINT [FK_Environment_Suite] FOREIGN KEY ([SuiteId]) REFERENCES [Config].[Suite] ([SuiteId]) | ||
); | ||
|
6 changes: 6 additions & 0 deletions
6
KonfDB.Engine/Assets/Scripts/MsSql/Config/EnvironmentType.sql
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
CREATE TABLE [Config].[EnvironmentType] ( | ||
[EnvironmentTypeId] INT NOT NULL, | ||
[TypeName] VARCHAR (30) NOT NULL, | ||
CONSTRAINT [PK_EnvironmentType] PRIMARY KEY CLUSTERED ([EnvironmentTypeId] ASC) | ||
); | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
CREATE TABLE [Config].[Mapping] ( | ||
[MappingId] BIGINT IDENTITY (1, 1) NOT NULL, | ||
[SuiteId] BIGINT NOT NULL, | ||
[EnvironmentId] BIGINT NOT NULL, | ||
[ApplicationId] BIGINT NOT NULL, | ||
[RegionId] BIGINT NOT NULL, | ||
[ServerId] BIGINT NOT NULL, | ||
[CategoryId] BIGINT NULL, | ||
[ParameterId] BIGINT NOT NULL, | ||
CONSTRAINT [PK_Mapping] PRIMARY KEY CLUSTERED ([MappingId] ASC), | ||
CONSTRAINT [FK_Mapping_Application] FOREIGN KEY ([ApplicationId]) REFERENCES [Config].[Application] ([ApplicationId]), | ||
CONSTRAINT [FK_Mapping_Environment] FOREIGN KEY ([EnvironmentId]) REFERENCES [Config].[Environment] ([EnvironmentId]), | ||
CONSTRAINT [FK_Mapping_Mapping] FOREIGN KEY ([ParameterId]) REFERENCES [Config].[Parameter] ([ParameterId]), | ||
CONSTRAINT [FK_Mapping_Region] FOREIGN KEY ([RegionId]) REFERENCES [Config].[Region] ([RegionId]), | ||
CONSTRAINT [FK_Mapping_Server] FOREIGN KEY ([ServerId]) REFERENCES [Config].[Server] ([ServerId]), | ||
CONSTRAINT [FK_Mapping_Suite] FOREIGN KEY ([SuiteId]) REFERENCES [Config].[Suite] ([SuiteId]) | ||
); | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
CREATE TABLE [Config].[Parameter] ( | ||
[ParameterId] BIGINT IDENTITY (1, 1) NOT NULL, | ||
[CategoryId] BIGINT NOT NULL, | ||
[SuiteId] BIGINT NOT NULL, | ||
[ParameterName] NVARCHAR (100) NOT NULL, | ||
[ParameterValue] NVARCHAR (MAX) NOT NULL, | ||
[IsEncrypted] BIT CONSTRAINT [DF_Parameter_IsEncrypted] DEFAULT ((1)) NOT NULL, | ||
[IsActive] BIT CONSTRAINT [DF_Parameter_IsActive] DEFAULT ((1)) NOT NULL, | ||
CONSTRAINT [PK_Parameter] PRIMARY KEY CLUSTERED ([ParameterId] ASC), | ||
CONSTRAINT [FK_Parameter_Suite] FOREIGN KEY ([SuiteId]) REFERENCES [Config].[Suite] ([SuiteId]) | ||
); | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
CREATE TABLE [Config].[Region] ( | ||
[RegionId] BIGINT IDENTITY (1, 1) NOT NULL, | ||
[SuiteId] BIGINT NOT NULL, | ||
[RegionName] VARCHAR (60) NOT NULL, | ||
[Description] NVARCHAR (MAX) NULL, | ||
[IsActive] BIT CONSTRAINT [DF_Region_IsActive] DEFAULT ((1)) NOT NULL, | ||
CONSTRAINT [PK_Region] PRIMARY KEY CLUSTERED ([RegionId] ASC), | ||
CONSTRAINT [FK_Region_Suite] FOREIGN KEY ([SuiteId]) REFERENCES [Config].[Suite] ([SuiteId]) | ||
); | ||
|
||
|
||
|
||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
CREATE TABLE [Config].[Server] ( | ||
[ServerId] BIGINT IDENTITY (1, 1) NOT NULL, | ||
[SuiteId] BIGINT NOT NULL, | ||
[ServerName] VARCHAR (60) NOT NULL, | ||
[Description] NVARCHAR (MAX) NULL, | ||
[IsActive] BIT CONSTRAINT [DF_Server_IsActive] DEFAULT ((1)) NOT NULL, | ||
CONSTRAINT [PK_Server] PRIMARY KEY CLUSTERED ([ServerId] ASC), | ||
CONSTRAINT [FK_Server_Suite] FOREIGN KEY ([SuiteId]) REFERENCES [Config].[Suite] ([SuiteId]) | ||
); | ||
|
||
|
||
|
||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
CREATE TABLE [Config].[Suite] ( | ||
[SuiteId] BIGINT IDENTITY (1, 1) NOT NULL, | ||
[SuiteName] VARCHAR (60) NOT NULL, | ||
[IsActive] BIT CONSTRAINT [DF_Suites_IsActive] DEFAULT ((1)) NOT NULL, | ||
[UsesSysEncryption] BIT CONSTRAINT [DF_Suite_UseSystemEncryption] DEFAULT ((1)) NOT NULL, | ||
[PublicKey] NVARCHAR (1000) NULL, | ||
[PrivateKey] NVARCHAR (1000) NULL, | ||
[CreatedDate] DATETIME CONSTRAINT [DF_Suite_CreatedDate] DEFAULT (getdate()) NULL, | ||
[Timestamp] ROWVERSION NULL, | ||
[SuiteType] INT CONSTRAINT [DF_Suite_SuiteType] DEFAULT ((0)) NULL, | ||
CONSTRAINT [PK_Suites] PRIMARY KEY CLUSTERED ([SuiteId] ASC) | ||
); | ||
|
||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
CREATE TABLE [Config].[SuiteUsers] ( | ||
[AutoId] INT IDENTITY (1, 1) NOT NULL, | ||
[SuiteId] BIGINT NOT NULL, | ||
[UserId] INT NOT NULL, | ||
[RoleId] [int] NULL, | ||
CONSTRAINT [PK_SuiteUsers_1] PRIMARY KEY CLUSTERED ([AutoId] ASC), | ||
CONSTRAINT [FK_Config.SuiteUsers_Suite] FOREIGN KEY ([SuiteId]) REFERENCES [Config].[Suite] ([SuiteId]), | ||
CONSTRAINT [FK_Config.SuiteUsers_Users] FOREIGN KEY ([UserId]) REFERENCES [Account].[Users] ([UserId]), | ||
CONSTRAINT [FK_Config.SuiteUsers_Roles] FOREIGN KEY ([RoleId]) REFERENCES [Account].[Roles] ([RoleId]) | ||
); | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
IF NOT EXISTS(SELECT * FROM [Config].[AuditArea] WHERE AuditAreaId=100) INSERT INTO [Config].[AuditArea] VALUES (100, 'Access') ELSE UPDATE [Config].[AuditArea] SET AuditAreaName='Access' WHERE AuditAreaId=100 | ||
IF NOT EXISTS(SELECT * FROM [Config].[AuditArea] WHERE AuditAreaId=200) INSERT INTO [Config].[AuditArea] VALUES (200, 'Application') ELSE UPDATE [Config].[AuditArea] SET AuditAreaName='Application' WHERE AuditAreaId=200 | ||
IF NOT EXISTS(SELECT * FROM [Config].[AuditArea] WHERE AuditAreaId=300) INSERT INTO [Config].[AuditArea] VALUES (300, 'Environment') ELSE UPDATE [Config].[AuditArea] SET AuditAreaName='Environment' WHERE AuditAreaId=300 | ||
IF NOT EXISTS(SELECT * FROM [Config].[AuditArea] WHERE AuditAreaId=400) INSERT INTO [Config].[AuditArea] VALUES (400, 'Mappint') ELSE UPDATE [Config].[AuditArea] SET AuditAreaName='Mapping' WHERE AuditAreaId=400 | ||
IF NOT EXISTS(SELECT * FROM [Config].[AuditArea] WHERE AuditAreaId=500) INSERT INTO [Config].[AuditArea] VALUES (500, 'Parameter') ELSE UPDATE [Config].[AuditArea] SET AuditAreaName='Parameter' WHERE AuditAreaId=500 | ||
IF NOT EXISTS(SELECT * FROM [Config].[AuditArea] WHERE AuditAreaId=600) INSERT INTO [Config].[AuditArea] VALUES (600, 'Region') ELSE UPDATE [Config].[AuditArea] SET AuditAreaName='Region' WHERE AuditAreaId=600 | ||
IF NOT EXISTS(SELECT * FROM [Config].[AuditArea] WHERE AuditAreaId=700) INSERT INTO [Config].[AuditArea] VALUES (700, 'Server') ELSE UPDATE [Config].[AuditArea] SET AuditAreaName='Server' WHERE AuditAreaId=700 | ||
IF NOT EXISTS(SELECT * FROM [Config].[AuditArea] WHERE AuditAreaId=800) INSERT INTO [Config].[AuditArea] VALUES (800, 'Suite') ELSE UPDATE [Config].[AuditArea] SET AuditAreaName='Suite' WHERE AuditAreaId=800 | ||
IF NOT EXISTS(SELECT * FROM [Config].[AuditArea] WHERE AuditAreaId=1000) INSERT INTO [Config].[AuditArea] VALUES (1000, 'Login') ELSE UPDATE [Config].[AuditArea] SET AuditAreaName='Login' WHERE AuditAreaId=1000 | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
IF NOT EXISTS(SELECT * FROM [Config].[EnvironmentType] WHERE EnvironmentTypeId=400) INSERT INTO [Config].[EnvironmentType] VALUES (400, 'DEV') ELSE UPDATE [Config].[EnvironmentType] SET TypeName='DEV' WHERE EnvironmentTypeId=400 | ||
IF NOT EXISTS(SELECT * FROM [Config].[EnvironmentType] WHERE EnvironmentTypeId=401) INSERT INTO [Config].[EnvironmentType] VALUES (401, 'QA') ELSE UPDATE [Config].[EnvironmentType] SET TypeName='DEV' WHERE EnvironmentTypeId=401 | ||
IF NOT EXISTS(SELECT * FROM [Config].[EnvironmentType] WHERE EnvironmentTypeId=402) INSERT INTO [Config].[EnvironmentType] VALUES (402, 'UAT') ELSE UPDATE [Config].[EnvironmentType] SET TypeName='DEV' WHERE EnvironmentTypeId=402 | ||
IF NOT EXISTS(SELECT * FROM [Config].[EnvironmentType] WHERE EnvironmentTypeId=403) INSERT INTO [Config].[EnvironmentType] VALUES (403, 'SIT') ELSE UPDATE [Config].[EnvironmentType] SET TypeName='DEV' WHERE EnvironmentTypeId=403 | ||
IF NOT EXISTS(SELECT * FROM [Config].[EnvironmentType] WHERE EnvironmentTypeId=404) INSERT INTO [Config].[EnvironmentType] VALUES (404, 'PROD') ELSE UPDATE [Config].[EnvironmentType] SET TypeName='DEV' WHERE EnvironmentTypeId=404 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
-- Add Roles | ||
|
||
IF NOT EXISTS(SELECT * FROM [Account].[Roles] WHERE RoleId=100) | ||
BEGIN | ||
SET IDENTITY_INSERT [Account].[Roles] ON | ||
INSERT INTO [Account].[Roles] (RoleId, RoleName) VALUES (100, 'Administrator') | ||
SET IDENTITY_INSERT [Account].[Roles] OFF | ||
END | ||
ELSE | ||
UPDATE [Account].[Roles] SET RoleName='Admin' WHERE RoleId=100 | ||
|
||
|
||
IF NOT EXISTS(SELECT * FROM [Account].[Roles] WHERE RoleId=200) | ||
BEGIN | ||
SET IDENTITY_INSERT [Account].[Roles] ON | ||
INSERT INTO [Account].[Roles] (RoleId, RoleName) VALUES (200, 'ReadOnly') | ||
SET IDENTITY_INSERT [Account].[Roles] OFF | ||
END | ||
ELSE | ||
UPDATE [Account].[Roles] SET RoleName='ReadOnly' WHERE RoleId=200 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
CREATE DATABASE $InstanceName$ ON PRIMARY (NAME = $InstanceName$, FILENAME = '$Location$\$InstanceName$.mdf', SIZE = 5MB, MAXSIZE = 10MB, FILEGROWTH = 10%) | ||
LOG ON (NAME = $InstanceName$_Log, FILENAME = '$Location$\$InstanceName$.ldf', SIZE = 1MB, MAXSIZE = 5MB, FILEGROWTH = 10%) | ||
--go | ||
|
||
--CREATE SCHEMA [Config] AUTHORIZATION [dbo]; | ||
--go | ||
|
||
|
||
|
||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
CREATE TABLE [Reference].[City] ( | ||
[CityId] INT NOT NULL, | ||
[CountryId] INT NOT NULL, | ||
[City] VARCHAR (50) NOT NULL, | ||
CONSTRAINT [PK_Reference.City] PRIMARY KEY CLUSTERED ([CityId] ASC), | ||
CONSTRAINT [FK_Reference.City_Reference.Country] FOREIGN KEY ([CountryId]) REFERENCES [Reference].[Country] ([CountryId]) | ||
); | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
CREATE TABLE [Reference].[Country] ( | ||
[CountryId] INT IDENTITY (100, 1) NOT NULL, | ||
[CountryName] VARCHAR (70) NOT NULL, | ||
[ISO2] VARCHAR (2) NULL, | ||
[ISO3] VARCHAR (3) NULL, | ||
CONSTRAINT [PK_Reference.Country] PRIMARY KEY CLUSTERED ([CountryId] ASC) | ||
); | ||
|
||
|
||
|
||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
CREATE SCHEMA [Account] AUTHORIZATION [dbo]; | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
CREATE SCHEMA [Audit] AUTHORIZATION [dbo]; | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
CREATE SCHEMA [Config] AUTHORIZATION [dbo]; | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
CREATE SCHEMA [Reference] AUTHORIZATION [dbo]; | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--CREATE SCHEMA [Config] AUTHORIZATION [dbo]; | ||
|
||
|
||
|
||
|
||
|
Oops, something went wrong.