Skip to content
This repository has been archived by the owner on May 8, 2023. It is now read-only.

Commit

Permalink
Merge branch 'main' into 1070_bug_fixes_cim_conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
x-platformcoder authored Nov 24, 2022
2 parents 1584c0d + 0e4532f commit e867232
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ limitations under the License.
<EmbeddedResource Include="Scripts\Model\202210201038 Create ChargeMessage table.sql" />
<EmbeddedResource Include="Scripts\Model\202210221245 Recreate ChargeMessage table.sql" />
<EmbeddedResource Include="Scripts\Model\202210251454 Add MessageType and MessageDateTime columns to ChargeMessage table.sql" />
<EmbeddedResource Include="Scripts\Model\202211221157 Create Charge History Table.sql" />
<EmbeddedResource Include="Scripts\Seed\202201261740 Add default charges owner.sql" />
<EmbeddedResource Include="Scripts\Seed\202201261741 Add default charges.sql" />
<EmbeddedResource Include="Scripts\Seed\202201261742 Add default charge links.sql" />
Expand Down
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

0 comments on commit e867232

Please sign in to comment.