-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from goodtocode/31-subjects-business-crud-func…
…tions 31 subjects business crud functions
- Loading branch information
Showing
561 changed files
with
9,221 additions
and
435 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
11 changes: 11 additions & 0 deletions
11
data/Entity.Database/Activity/Stored Procedures/ExceptionLogInsertByException.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,11 @@ | ||
CREATE PROCEDURE [Activity].[ExceptionLogInsertByException] | ||
AS | ||
-- Build data into message | ||
Declare @CustomMessage nvarchar(max) | ||
Select @CustomMessage = 'Number: ' + Cast(ERROR_NUMBER() As nvarchar(100)) | ||
+ ' Severity: ' + Cast(ERROR_SEVERITY() As nvarchar(100)) | ||
+ ' State: ' + Cast(ERROR_STATE() As nvarchar(100)) | ||
+ ' Procedure: ' + Cast(ERROR_PROCEDURE() As nvarchar(500)) | ||
+ ' Line: ' + Cast(ERROR_LINE() As nvarchar(100)) | ||
INSERT INTO [Activity].[ExceptionLog] ([Message], [CustomMessage]) | ||
SELECT ERROR_MESSAGE() AS [Message], IsNull(@CustomMessage, '') As [CustomMessage] |
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,21 @@ | ||
CREATE TABLE [Activity].[ExceptionLog] ( | ||
[ExceptionLogId] INT IDENTITY (1, 1) NOT NULL, | ||
[ExceptionLogKey] UniqueIdentifier CONSTRAINT [DF_ExceptionLog_ExceptionLogKey] DEFAULT (NewID()) NOT NULL, | ||
[AssemblyName] NVARCHAR (MAX) CONSTRAINT [DF_ExceptionLog_AssemblyName] DEFAULT ('') NOT NULL, | ||
[Message] NVARCHAR (MAX) CONSTRAINT [DF_ExceptionLog_Message] DEFAULT ('') NOT NULL, | ||
[InnerException] NVARCHAR (MAX) CONSTRAINT [DF_ExceptionLog_InnerException] DEFAULT ('') NOT NULL, | ||
[StackTrace] NVARCHAR (MAX) CONSTRAINT [DF_ExceptionLog_StackTrace] DEFAULT ('') NOT NULL, | ||
[ADDomainName] NVARCHAR (MAX) CONSTRAINT [DF_ExceptionLog_ExceptionADDomainName] DEFAULT ('') NOT NULL, | ||
[ADUserName] NVARCHAR (MAX) CONSTRAINT [DF_ExceptionLog_ExceptionADUserName] DEFAULT ('') NOT NULL, | ||
[DirectoryWorking] NVARCHAR (MAX) CONSTRAINT [DF_ExceptionLog_ExceptionDirectoryWorking] DEFAULT ('') NOT NULL, | ||
[DirectoryAssembly] NVARCHAR (MAX) CONSTRAINT [DF_ExceptionLog_ExceptionDirectoryAssembly] DEFAULT ('') NOT NULL, | ||
[URL] NVARCHAR (MAX) CONSTRAINT [DF_ExceptionLog_URL] DEFAULT ('') NOT NULL, | ||
[CustomMessage] NVARCHAR (MAX) CONSTRAINT [DF_ExceptionLog_CustomMessage] DEFAULT ('') NOT NULL, | ||
[Discriminator] NVARCHAR (128) CONSTRAINT [DF_ExceptionLog_Discriminator] DEFAULT ('') NOT NULL, | ||
[CreatedDate] DATETIME CONSTRAINT [DF_ExceptionLog_CreatedDate] DEFAULT (getutcdate()) NOT NULL, | ||
CONSTRAINT [PK_Exception] PRIMARY KEY CLUSTERED ([ExceptionLogId] ASC) | ||
); | ||
GO | ||
CREATE NonCLUSTERED INDEX [IX_ExceptionLog_ExceptionLogKey] ON [Activity].[ExceptionLog] ([ExceptionLogKey] Asc) | ||
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,15 @@ | ||
ECHO OFF | ||
ECHO Starting PostBuild.bat %1 %2 %3 | ||
REM Usage: Call "$(MSBuildProjectDirectory)\App_Data\PostBuild.$(ConfigurationName).bat" "$(MSBuildProjectDirectory)\$(OutDir)" "$(ConfigurationName)" "$(ProjectName)" | ||
REM Vars: $(ProjectName) = MyCo.Framework. Models, $(TargetPath) = output file, $(TargetDir) = full bin path , $(OutDir) = bin\debug, $(ConfigurationName) = "Debug" | ||
|
||
REM Locals | ||
SET FullPath=%1 | ||
SET FullPath=%FullPath:"=% | ||
ECHO FullPath: %FullPath% | ||
SET Configuration=%2 | ||
ECHO Configuration: %Configuration% | ||
SET ProjectName=%3 | ||
ECHO ProjectName: %ProjectName% | ||
|
||
Exit 0 |
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 @@ | ||
ECHO OFF | ||
ECHO Starting PostBuild.bat %1 %2 %3 | ||
REM Usage: Call "$(MSBuildProjectDirectory)\App_Data\PostBuild.$(ConfigurationName).bat" "$(MSBuildProjectDirectory)\$(OutDir)" "$(ConfigurationName)" "$(ProjectName)" | ||
REM Vars: $(ProjectName) = MyCo.Framework. Models, $(TargetPath) = output file, $(TargetDir) = full bin path , $(OutDir) = bin\debug, $(ConfigurationName) = "Debug" | ||
|
||
REM Locals | ||
SET FullPath=%1 | ||
SET FullPath=%FullPath:"=% | ||
ECHO FullPath: %FullPath% | ||
SET Configuration=%2 | ||
ECHO Configuration: %Configuration% | ||
SET ProjectName=%3 | ||
ECHO ProjectName: %ProjectName% | ||
|
||
Exit 0 |
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 @@ | ||
ECHO OFF | ||
ECHO Starting PreBuild.bat %1 %2 %3 | ||
REM Usage: Call "$(MSBuildProjectDirectory)\App_Data\PreBuild.$(ConfigurationName).bat" "$(MSBuildProjectDirectory)" "$(ConfigurationName)" "$(ProjectName)" | ||
REM Vars: $(ProjectName) = MyCo.Framework. Models, $(TargetPath) = output file, $(TargetDir) = full bin path , $(OutDir) = bin\debug, $(ConfigurationName) = "Debug" | ||
|
||
REM Locals | ||
SET FullPath=%1 | ||
SET FullPath=%FullPath:"=% | ||
ECHO FullPath: %FullPath% | ||
SET Configuration=%2 | ||
ECHO Configuration: %Configuration% | ||
SET ProjectName=%3 | ||
ECHO ProjectName: %ProjectName% | ||
|
||
exit 0 |
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 @@ | ||
ECHO OFF | ||
ECHO Starting PreBuild.bat %1 %2 %3 | ||
REM Usage: Call "$(MSBuildProjectDirectory)\App_Data\PreBuild.$(ConfigurationName).bat" "$(MSBuildProjectDirectory)" "$(ConfigurationName)" "$(ProjectName)" | ||
REM Vars: $(ProjectName) = MyCo.Framework. Models, $(TargetPath) = output file, $(TargetDir) = full bin path , $(OutDir) = bin\debug, $(ConfigurationName) = "Debug" | ||
|
||
REM Locals | ||
SET FullPath=%1 | ||
SET FullPath=%FullPath:"=% | ||
ECHO FullPath: %FullPath% | ||
SET Configuration=%2 | ||
ECHO Configuration: %Configuration% | ||
SET ProjectName=%3 | ||
ECHO ProjectName: %ProjectName% | ||
|
||
exit 0 |
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 [Entity].[Application] ( | ||
[ApplicationId] INT IDENTITY (1, 1) CONSTRAINT [DF_Application_ApplicationId] NOT NULL, | ||
[ApplicationKey] UNIQUEIDENTIFIER CONSTRAINT [DF_Application_ApplicationKey] DEFAULT (NewID()) NOT NULL, | ||
[ApplicationName] NVARCHAR (50) CONSTRAINT [DF_Application_ApplicationName] DEFAULT ('') NOT NULL, | ||
[ApplicationSlogan] NVARCHAR (50) CONSTRAINT [DF_Application_ApplicationSlogan] DEFAULT ('') NOT NULL, | ||
[SharedApplicationKey] UNIQUEIDENTIFIER CONSTRAINT [DF_Application_SharedApplicationKey] DEFAULT('00000000-0000-0000-0000-000000000000') NOT NULL, | ||
[SharedSecret] INT CONSTRAINT [DF_Application_SharedSecret] DEFAULT(-1) NOT NULL, | ||
[BusinessEntityKey] UNIQUEIDENTIFIER CONSTRAINT [DF_Application_BusinessEntity] DEFAULT('00000000-0000-0000-0000-000000000000') NOT NULL, | ||
[PrivacyUrl] NVARCHAR (250) CONSTRAINT [DF_Application_PrivacyUrl] DEFAULT ('') NOT NULL, | ||
[TermsUrl] NVARCHAR (250) CONSTRAINT [DF_Application_TermsUrl] DEFAULT ('') NOT NULL, | ||
[TermsRevisedDate] DATETIME CONSTRAINT [DF_Application_TermsRevisedDate] DEFAULT (getutcdate()) NOT NULL, | ||
[CreatedDate] DATETIME CONSTRAINT [DF_Application_CreatedDate] DEFAULT (getutcdate()) NOT NULL, | ||
[ModifiedDate] DATETIME CONSTRAINT [DF_Application_ModifiedDate] DEFAULT (getutcdate()) NOT NULL, | ||
CONSTRAINT [PK_Application] PRIMARY KEY CLUSTERED ([ApplicationId] ASC), | ||
CONSTRAINT [FK_Application_BusinessEntity] FOREIGN KEY ([BusinessEntityKey]) REFERENCES [Entity].[Entity] ([EntityKey]) | ||
); | ||
GO | ||
CREATE UNIQUE NonCLUSTERED INDEX [IX_Application_Key] ON [Entity].[Application] ([ApplicationKey] Asc) | ||
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,22 @@ | ||
CREATE TABLE [Entity].[Appointment] ( | ||
[AppointmentId] INT IDENTITY (1, 1) CONSTRAINT [DF_Appointment_AppointmentId] NOT NULL, | ||
[AppointmentKey] UNIQUEIDENTIFIER CONSTRAINT [DF_Appointment_AppointmentKey] DEFAULT (NewID()) NOT NULL, | ||
[AppointmentName] NVARCHAR (50) CONSTRAINT [DF_Appointment_AppointmentName] DEFAULT ('') NOT NULL, | ||
[AppointmentDescription] NVARCHAR (2000) CONSTRAINT [DF_Appointment_AppointmentDescription] DEFAULT ('') NOT NULL, | ||
[SlotLocationKey] UNIQUEIDENTIFIER CONSTRAINT [DF_Appointment_SlotLocation] DEFAULT('00000000-0000-0000-0000-000000000000') NULL, | ||
[SlotResourceKey] UNIQUEIDENTIFIER CONSTRAINT [DF_Appointment_SlotResource] DEFAULT('00000000-0000-0000-0000-000000000000') NULL, | ||
[TimeRangeKey] UNIQUEIDENTIFIER CONSTRAINT [DF_Appointment_TimeRangeId] DEFAULT('00000000-0000-0000-0000-000000000000') NOT NULL, | ||
[RecordStateKey] UNIQUEIDENTIFIER CONSTRAINT [DF_Appointment_RecordState] DEFAULT('00000000-0000-0000-0000-000000000000') NOT NULL, | ||
[CreatedDate] DATETIME CONSTRAINT [DF_Appointment_CreatedDate] DEFAULT (getutcdate()) NOT NULL, | ||
[ModifiedDate] DATETIME CONSTRAINT [DF_Appointment_ModifiedDate] DEFAULT (getutcdate()) NOT NULL, | ||
CONSTRAINT [PK_Appointment] PRIMARY KEY CLUSTERED ([AppointmentId] ASC), | ||
CONSTRAINT [FK_Appointment_Location] FOREIGN KEY ([SlotLocationKey]) REFERENCES [Entity].[SlotLocation] ([SlotLocationKey]), | ||
CONSTRAINT [FK_Appointment_Resource] FOREIGN KEY ([SlotResourceKey]) REFERENCES [Entity].[SlotResource] ([SlotResourceKey]), | ||
CONSTRAINT [FK_Appointment_TimeRange] FOREIGN KEY ([TimeRangeKey]) REFERENCES [Entity].[TimeRange] ([TimeRangeKey]), | ||
CONSTRAINT [FK_Appointment_RecordState] FOREIGN KEY ([RecordStateKey]) REFERENCES [Entity].[RecordState] ([RecordStateKey]) | ||
); | ||
GO | ||
CREATE UNIQUE NonCLUSTERED INDEX [IX_Appointment_Key] ON [Entity].[Appointment] ([AppointmentKey] Asc) | ||
GO | ||
CREATE UNIQUE NonCLUSTERED INDEX [IX_LocationTime_All] ON [Entity].[Appointment] ([SlotLocationKey] Asc, [SlotResourceKey] Asc, [TimeRangeKey] Asc) | ||
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,10 @@ | ||
CREATE TABLE [Entity].[Area] ( | ||
[AreaId] INT IDENTITY (1, 1) CONSTRAINT [DF_Area_Id] NOT NULL, | ||
[AreaKey] UNIQUEIDENTIFIER CONSTRAINT [DF_Area_Key] NOT NULL DEFAULT(NewId()), | ||
[Area] Geometry NOT NULL, | ||
[CreatedDate] DATETIME CONSTRAINT [DF_Area_CreatedDate] DEFAULT (getutcdate()) NOT NULL, | ||
CONSTRAINT [PK_Area] PRIMARY KEY CLUSTERED ([AreaId] ASC) | ||
); | ||
GO | ||
CREATE UNIQUE NonCLUSTERED INDEX [IX_Area_Key] ON [Entity].[Area] ([AreaKey] Asc) | ||
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,15 @@ | ||
CREATE TABLE [Entity].[Business] ( | ||
[BusinessId] INT IDENTITY (1, 1) CONSTRAINT [DF_Business_Business] NOT NULL, | ||
[BusinessKey] UNIQUEIDENTIFIER CONSTRAINT [DF_Business_Entity] DEFAULT(NewId()) NOT NULL, | ||
[BusinessName] NVARCHAR (50) CONSTRAINT [DF_Business_BusinessName] DEFAULT ('') NOT NULL, | ||
[TaxNumber] NVARCHAR (20) CONSTRAINT [DF_Business_TaxNumber] DEFAULT ('') NOT NULL, | ||
[RecordStateKey] UNIQUEIDENTIFIER CONSTRAINT [DF_Business_RecordState] DEFAULT('00000000-0000-0000-0000-000000000000') NOT NULL, | ||
[CreatedDate] DATETIME CONSTRAINT [DF_Business_CreatedDate] DEFAULT (getutcdate()) NOT NULL, | ||
[ModifiedDate] DATETIME CONSTRAINT [DF_Business_ModifiedDate] DEFAULT (getutcdate()) NOT NULL, | ||
CONSTRAINT [PK_Business] PRIMARY KEY CLUSTERED ([BusinessId] ASC), | ||
CONSTRAINT [FK_Business_Entity] FOREIGN KEY ([BusinessKey]) REFERENCES [Entity].[Entity] ([EntityKey]), | ||
CONSTRAINT [FK_Business_RecordState] FOREIGN KEY ([RecordStateKey]) REFERENCES [Entity].[RecordState] ([RecordStateKey]) | ||
); | ||
GO | ||
CREATE UNIQUE NonCLUSTERED INDEX [IX_BusinessEntity_Entity] ON [Entity].[Business] ([BusinessKey] Asc) | ||
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,13 @@ | ||
CREATE TABLE [Entity].[Detail] ( | ||
[DetailId] INT IDENTITY (1, 1) CONSTRAINT [DF_Detail_Id] NOT NULL, | ||
[DetailKey] UNIQUEIDENTIFIER CONSTRAINT [DF_Detail_Key] DEFAULT (NewID()) NOT NULL, | ||
[DetailTypeKey] UNIQUEIDENTIFIER CONSTRAINT [DF_Detail_DetailType] DEFAULT('00000000-0000-0000-0000-000000000000') NOT NULL, | ||
[DetailData] NVARCHAR (2000) CONSTRAINT [DF_Detail_DetailData] DEFAULT ('') NOT NULL, | ||
[CreatedDate] DATETIME CONSTRAINT [DF_Detail_CreatedDate] DEFAULT (getutcdate()) NOT NULL, | ||
[ModifiedDate] DATETIME CONSTRAINT [DF_Detail_ModifiedDate] DEFAULT (getutcdate()) NOT NULL, | ||
CONSTRAINT [PK_Detail] PRIMARY KEY CLUSTERED ([DetailId] ASC), | ||
CONSTRAINT [FK_Detail_DetailType] FOREIGN KEY ([DetailTypeKey]) REFERENCES [Entity].[DetailType] ([DetailTypeKey]) | ||
); | ||
GO | ||
CREATE UNIQUE NonCLUSTERED INDEX [IX_Detail_Key] ON [Entity].[Detail] ([DetailKey] Asc) | ||
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,12 @@ | ||
CREATE TABLE [Entity].[DetailType] ( | ||
[DetailTypeId] INT IDENTITY (1, 1) CONSTRAINT [DF_DetailType_DetailTypeId] NOT NULL, | ||
[DetailTypeKey] UNIQUEIDENTIFIER CONSTRAINT [DF_DetailType_DetailTypeKey] DEFAULT (NewId()) NOT NULL, | ||
[DetailTypeName] NVARCHAR (50) CONSTRAINT [DF_DetailType_DetailTypeName] DEFAULT ('') NOT NULL, | ||
[DetailTypeDescription] NVARCHAR (250) CONSTRAINT [DF_DetailType_DetailTypeDescription] DEFAULT ('') NOT NULL, | ||
[CreatedDate] DATETIME CONSTRAINT [DF_DetailType_CreatedDate] DEFAULT (getutcdate()) NOT NULL, | ||
[ModifiedDate] DATETIME CONSTRAINT [DF_DetailType_ModifiedDate] DEFAULT (getutcdate()) NOT NULL, | ||
CONSTRAINT [PK_DetailType] PRIMARY KEY CLUSTERED ([DetailTypeId] ASC) | ||
); | ||
GO | ||
CREATE UNIQUE NonCLUSTERED INDEX [IX_DetailType_Key] ON [Entity].[DetailType] ([DetailTypeKey] Asc) | ||
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,10 @@ | ||
CREATE TABLE [Entity].[Entity] ( | ||
[EntityId] INT IDENTITY (1, 1) CONSTRAINT [DF_Entity_EntityId] NOT NULL, | ||
[EntityKey] UNIQUEIDENTIFIER CONSTRAINT [DF_Entity_EntityKey] DEFAULT('00000000-0000-0000-0000-000000000000') NOT NULL, | ||
[CreatedDate] DATETIME CONSTRAINT [DF_Entity_CreatedDate] DEFAULT (getutcdate()) NOT NULL, | ||
[ModifiedDate] DATETIME CONSTRAINT [DF_Entity_ModifiedDate] DEFAULT (getutcdate()) NOT NULL, | ||
CONSTRAINT [PK_Entity] PRIMARY KEY CLUSTERED ([EntityId] ASC) | ||
); | ||
GO | ||
CREATE UNIQUE NonCLUSTERED INDEX [IX_Entity_EntityKey] ON [Entity].[Entity] ([EntityKey] Asc) | ||
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,18 @@ | ||
CREATE TABLE [Entity].[EntityAppointment] ( | ||
[EntityAppointmentId] INT IDENTITY (1, 1) CONSTRAINT [DF_EntityAppointment_Id] NOT NULL, | ||
[EntityAppointmentKey] UNIQUEIDENTIFIER CONSTRAINT [DF_EntityAppointment_Key] DEFAULT(NewId()) NOT NULL, | ||
[EntityKey] UNIQUEIDENTIFIER CONSTRAINT [DF_EntityAppointment_EntityId] DEFAULT('00000000-0000-0000-0000-000000000000') NOT NULL, | ||
[AppointmentKey] UNIQUEIDENTIFIER CONSTRAINT [DF_EntityAppointment_AppointmentId] DEFAULT('00000000-0000-0000-0000-000000000000') NOT NULL, | ||
[RecordStateKey] UNIQUEIDENTIFIER CONSTRAINT [DF_EntityAppointment_RecordState] DEFAULT('00000000-0000-0000-0000-000000000000') NOT NULL, | ||
[CreatedDate] DATETIME CONSTRAINT [DF_EntityAppointment_CreatedDate] DEFAULT (getutcdate()) NOT NULL, | ||
[ModifiedDate] DATETIME CONSTRAINT [DF_EntityAppointment_ModifiedDate] DEFAULT (getutcdate()) NOT NULL, | ||
CONSTRAINT [PK_EntityAppointment] PRIMARY KEY CLUSTERED ([EntityAppointmentId] ASC), | ||
CONSTRAINT [FK_EntityAppointment_Entity] FOREIGN KEY ([EntityKey]) REFERENCES [Entity].[Entity] ([EntityKey]), | ||
CONSTRAINT [FK_EntityAppointment_Appointment] FOREIGN KEY ([AppointmentKey]) REFERENCES [Entity].[Appointment] ([AppointmentKey]), | ||
CONSTRAINT [FK_EntityAppointment_RecordState] FOREIGN KEY ([RecordStateKey]) REFERENCES [Entity].[RecordState] ([RecordStateKey]) | ||
); | ||
GO | ||
CREATE UNIQUE NonCLUSTERED INDEX [IX_EntityAppointment_Key] ON [Entity].[EntityAppointment] ([EntityAppointmentKey] Asc) | ||
GO | ||
CREATE UNIQUE NonCLUSTERED INDEX [IX_EntityAppointment_All] ON [Entity].[EntityAppointment] ([EntityKey] Asc, [AppointmentKey] Asc) | ||
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,16 @@ | ||
CREATE TABLE [Entity].[EntityDetail] ( | ||
[EntityDetailId] INT IDENTITY (1, 1) CONSTRAINT [DF_EntityDetail_Id] NOT NULL, | ||
[EntityDetailKey] UNIQUEIDENTIFIER CONSTRAINT [DF_EntityDetail_Key] DEFAULT (NewID()) NOT NULL, | ||
[EntityKey] UNIQUEIDENTIFIER CONSTRAINT [DF_EntityDetail_Entity] DEFAULT('00000000-0000-0000-0000-000000000000') NOT NULL, | ||
[DetailKey] UNIQUEIDENTIFIER CONSTRAINT [DF_EntityDetail_Detail] DEFAULT('00000000-0000-0000-0000-000000000000') NOT NULL, | ||
[CreatedDate] DATETIME CONSTRAINT [DF_EntityDetail_CreatedDate] DEFAULT (getutcdate()) NOT NULL, | ||
[ModifiedDate] DATETIME CONSTRAINT [DF_EntityDetail_ModifiedDate] DEFAULT (getutcdate()) NOT NULL, | ||
CONSTRAINT [PK_EntityDetail] PRIMARY KEY CLUSTERED ([EntityDetailId] ASC), | ||
CONSTRAINT [FK_EntityDetail_Entity] FOREIGN KEY ([EntityKey]) REFERENCES [Entity].[Entity] ([EntityKey]), | ||
CONSTRAINT [FK_EntityDetail_Detail] FOREIGN KEY ([DetailKey]) REFERENCES [Entity].[Detail] ([DetailKey]), | ||
CONSTRAINT [UQ_EntityDetail_EntityDetailId] UNIQUE NONCLUSTERED ([EntityKey] ASC, [EntityDetailKey] ASC) | ||
); | ||
GO | ||
CREATE UNIQUE NonCLUSTERED INDEX [IX_EntityDetail_Key] ON [Entity].[EntityDetail] ([EntityDetailKey] Asc) | ||
GO | ||
CREATE UNIQUE NonCLUSTERED INDEX [IX_EntityDetail_All] ON [Entity].[EntityDetail] ([EntityKey] Asc, [EntityDetailKey] 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,20 @@ | ||
CREATE TABLE [Entity].[EntityLocation] ( | ||
[EntityLocationId] INT IDENTITY (1, 1) CONSTRAINT [DF_EntityLocation_Entity] NOT NULL, | ||
[EntityLocationKey] UNIQUEIDENTIFIER CONSTRAINT [DF_EntityLocation_Entity] DEFAULT(NewId()) NOT NULL, | ||
[EntityKey] UNIQUEIDENTIFIER CONSTRAINT [DF_EntityLocation_EntityKey] DEFAULT('00000000-0000-0000-0000-000000000000') NOT NULL, | ||
[LocationKey] UNIQUEIDENTIFIER CONSTRAINT [DF_EntityLocation_LocationKey] DEFAULT('00000000-0000-0000-0000-000000000000') NOT NULL, | ||
[LocationTypeKey] UNIQUEIDENTIFIER CONSTRAINT [DF_EntityLocation_LocationType] DEFAULT('00000000-0000-0000-0000-000000000000') NULL, | ||
[RecordStateKey] UNIQUEIDENTIFIER CONSTRAINT [DF_EntityLocation_RecordState] DEFAULT('00000000-0000-0000-0000-000000000000') NOT NULL, | ||
[CreatedDate] DATETIME CONSTRAINT [DF_EntityLocation_CreatedDate] DEFAULT (getutcdate()) NOT NULL, | ||
[ModifiedDate] DATETIME CONSTRAINT [DF_EntityLocation_ModifiedDate] DEFAULT (getutcdate()) NOT NULL, | ||
CONSTRAINT [PK_EntityLocation] PRIMARY KEY CLUSTERED ([EntityLocationId] ASC), | ||
CONSTRAINT [FK_EntityLocation_Entity] FOREIGN KEY ([EntityKey]) REFERENCES [Entity].[Entity] ([EntityKey]), | ||
CONSTRAINT [FK_EntityLocation_Location] FOREIGN KEY ([LocationKey]) REFERENCES [Entity].[Location] ([LocationKey]), | ||
CONSTRAINT [FK_EntityLocation_LocationType] FOREIGN KEY ([LocationTypeKey]) REFERENCES [Entity].[LocationType] ([LocationTypeKey]), | ||
CONSTRAINT [FK_EntityLocation_RecordState] FOREIGN KEY ([RecordStateKey]) REFERENCES [Entity].[RecordState] ([RecordStateKey]) | ||
); | ||
GO | ||
CREATE UNIQUE NonCLUSTERED INDEX [IX_EntityLocation_Entity] ON [Entity].[Entity] ([EntityKey] Asc) | ||
GO | ||
CREATE UNIQUE NonCLUSTERED INDEX [IX_EntityLocation_All] ON [Entity].[EntityLocation] ([EntityKey] Asc, [LocationKey] Asc) | ||
GO |
Oops, something went wrong.