This repository has been archived by the owner on May 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 1070_bug_fixes_cim_conversion
- Loading branch information
Showing
2 changed files
with
49 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
48 changes: 48 additions & 0 deletions
48
...b.Charges.ApplyDBMigrationsApp/Scripts/Model/202211221157 Create Charge History Table.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,48 @@ | ||
------------------------------------------------------------------------------------------------------------------------ | ||
-- ChargesQuery Schema | ||
------------------------------------------------------------------------------------------------------------------------ | ||
IF NOT EXISTS ( SELECT * | ||
FROM sys.schemas | ||
WHERE name = N'ChargesQuery' ) | ||
EXEC('CREATE SCHEMA [ChargesQuery]'); | ||
GO | ||
|
||
ALTER AUTHORIZATION ON SCHEMA::[ChargesQuery] TO [dbo]; | ||
GO | ||
|
||
------------------------------------------------------------------------------------------------------------------------ | ||
-- Create ChargeHistory table | ||
------------------------------------------------------------------------------------------------------------------------ | ||
|
||
CREATE TABLE [ChargesQuery].[ChargeHistory]( | ||
[Id] [uniqueidentifier] NOT NULL, | ||
[SenderProvidedChargeId] [nvarchar](35) NOT NULL, | ||
[Type] [int] NOT NULL, | ||
[Owner] [nvarchar](35) NOT NULL, | ||
[Name] [nvarchar](132) NOT NULL, | ||
[Description] [nvarchar](2048) NOT NULL, | ||
[Resolution] [int] NOT NULL, | ||
[TaxIndicator] [bit] NOT NULL, | ||
[TransparentInvoicing] [bit] NOT NULL, | ||
[VatClassification] [int] NOT NULL, | ||
[StartDateTime] [datetime2](7) NOT NULL, | ||
[EndDateTime] [datetime2](7) NOT NULL, | ||
[AcceptedDateTime] [datetime2](7) NOT NULL, | ||
CONSTRAINT [PK_ChargeHistory] PRIMARY KEY NONCLUSTERED | ||
( | ||
[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 | ||
|
||
------------------------------------------------------------------------------------------------------------------------ | ||
-- Add index | ||
------------------------------------------------------------------------------------------------------------------------ | ||
|
||
CREATE NONCLUSTERED INDEX [I1_SenderProvidedChargeId_Type_Owner] ON [ChargesQuery].[ChargeHistory] | ||
( | ||
[SenderProvidedChargeId] ASC, | ||
[Type] ASC, | ||
[Owner] ASC | ||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
GO |