-
Notifications
You must be signed in to change notification settings - Fork 18
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 #149 from Geta/sandbox/add-missing-build-files
Sandbox/add missing build files
- Loading branch information
Showing
22 changed files
with
119,434 additions
and
0 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
sandbox/Foundation/Build/SqlScripts/FoundationConfigurationSchema.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,41 @@ | ||
CREATE TABLE [dbo].[FoundationConfiguration] | ||
( | ||
[Id] [bigint] IDENTITY(1,1) NOT NULL, | ||
[AppName] NVARCHAR(250) NOT NULL, | ||
[IsInstalled] BIT NOT NULL DEFAULT(0), | ||
CONSTRAINT [PK_FoundationConfiguration] PRIMARY KEY CLUSTERED ([Id] ASC) | ||
); | ||
GO | ||
|
||
CREATE PROCEDURE [dbo].[FoundationConfiguration_List] | ||
AS | ||
BEGIN | ||
SELECT * FROM FoundationConfiguration | ||
END | ||
GO | ||
|
||
CREATE PROCEDURE [dbo].[FoundationConfiguration_SetInstalled] | ||
AS | ||
BEGIN | ||
UPDATE FoundationConfiguration SET IsInstalled = 1 | ||
END | ||
GO | ||
|
||
CREATE PROCEDURE [dbo].[FoundationConfiguration_Save] | ||
( | ||
@Id INT = 0, | ||
@AppName NVARCHAR(250), | ||
@IsInstalled BIT = 0 | ||
) | ||
AS | ||
BEGIN | ||
IF @Id > 0 | ||
UPDATE FoundationConfiguration SET AppName = @AppName, IsInstalled = @IsInstalled WHERE Id = @Id | ||
ELSE | ||
INSERT INTO FoundationConfiguration (AppName, IsInstalled) VALUES (@AppName, @IsInstalled) | ||
|
||
END | ||
GO | ||
|
||
INSERT INTO FoundationConfiguration (AppName) VALUES ( '$(appname)') | ||
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,38 @@ | ||
--beginvalidatingquery | ||
IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'dbo' AND TABLE_NAME = 'tblUserPermission') | ||
BEGIN | ||
IF NOT EXISTS (SELECT pkid FROM dbo.tblUserPermission WHERE Permission = 'WriteAccess' and GroupName = 'EPiServerServiceApi') | ||
SELECT 1, 'Installing Permissions' | ||
ELSE | ||
SELECT 0, 'Already installed default permissions' | ||
END | ||
ELSE | ||
select -1, 'Not an EPiServer CMS database' | ||
--endvalidatingquery | ||
|
||
GO | ||
|
||
INSERT INTO [dbo].[tblUserPermission] | ||
([Name] | ||
,[IsRole] | ||
,[Permission] | ||
,[GroupName]) | ||
VALUES | ||
('Administrators' | ||
,1 | ||
,'WriteAccess' | ||
,'EPiServerServiceApi') | ||
GO | ||
|
||
INSERT INTO [dbo].[tblUserPermission] | ||
([Name] | ||
,[IsRole] | ||
,[Permission] | ||
,[GroupName]) | ||
VALUES | ||
('Administrators' | ||
,1 | ||
,'ReadAccess' | ||
,'EPiServerServiceApi') | ||
|
||
GO |
37 changes: 37 additions & 0 deletions
37
sandbox/Foundation/Build/SqlScripts/ServiceApiCommerce.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,37 @@ | ||
--beginvalidatingquery | ||
IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'dbo' AND TABLE_NAME = 'SchemaVersion') | ||
BEGIN | ||
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id (N'[dbo].[ecf_CatalogEntry_Paging]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1) | ||
select 0,'Already correct database version' | ||
ELSE | ||
select 1, 'Upgrading database' | ||
END | ||
ELSE | ||
select -1, 'Not an EPiServer Commerce database' | ||
go | ||
--endvalidatingquery | ||
|
||
-- ecf_CatalogEntry_Paging.sql | ||
CREATE PROCEDURE [dbo].[ecf_CatalogEntry_Paging] | ||
@StartPage int, | ||
@PageSize int, | ||
@ReturnInactive bit = 0 | ||
AS | ||
BEGIN | ||
DECLARE @intStartRow int; | ||
DECLARE @intEndRow int; | ||
|
||
SET @intStartRow = (@StartPage -1) * @PageSize + 1; | ||
SET @intEndRow = @StartPage * @PageSize; | ||
|
||
WITH entries AS | ||
(SELECT CatalogEntryId, | ||
ROW_NUMBER() OVER(ORDER BY CatalogEntryId) as intRow, | ||
COUNT(CatalogEntryId) OVER() AS intTotalHits | ||
FROM CatalogEntry) | ||
|
||
SELECT CatalogEntryId, intTotalHits FROM entries | ||
WHERE intRow BETWEEN @intStartRow AND @intEndRow | ||
END | ||
go | ||
-- END OF ecf_CatalogEntry_Paging.sql |
116 changes: 116 additions & 0 deletions
116
sandbox/Foundation/Build/SqlScripts/UniqueCouponSchema.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,116 @@ | ||
CREATE TABLE [dbo].[UniqueCoupons] | ||
( | ||
[Id] [bigint] IDENTITY(1,1) NOT NULL, | ||
[PromotionId] [int] NOT NULL, | ||
[Code] [nvarchar](max) NOT NULL, | ||
[Valid] [datetime2](7) NOT NULL, | ||
[Expiration] [datetime2](7) NULL, | ||
[CustomerId] [uniqueidentifier] NULL, | ||
[Created] [datetime2](7) NULL, | ||
[MaxRedemptions] [int] NULL, | ||
[UsedRedemptions] [int] NULL, | ||
CONSTRAINT [PK_UniqueCoupons] PRIMARY KEY CLUSTERED ([Id] ASC) | ||
); | ||
GO | ||
|
||
CREATE NONCLUSTERED INDEX [IDX_UniqueCoupons_PromotionId] ON [dbo].[UniqueCoupons] | ||
( | ||
[PromotionId] ASC | ||
) | ||
GO | ||
|
||
CREATE TYPE [dbo].[udttUniqueCoupons] AS TABLE | ||
( | ||
[Id] [bigint] NOT NULL, | ||
[PromotionId] [int] NOT NULL, | ||
[Code] [nvarchar](max) NOT NULL, | ||
[Valid] [datetime2](7) NOT NULL, | ||
[Expiration] [datetime2](7) NULL, | ||
[CustomerId] [uniqueidentifier] NULL, | ||
[Created] [datetime2](7) NOT NULL, | ||
[MaxRedemptions] [int] NOT NULL, | ||
[UsedRedemptions] [int] NOT NULL | ||
); | ||
GO | ||
|
||
CREATE PROCEDURE [dbo].[UniqueCoupons_DeleteById] | ||
( | ||
@Id BIGINT | ||
) | ||
AS | ||
BEGIN | ||
DELETE FROM UniqueCoupons | ||
WHERE Id = @Id | ||
END | ||
GO | ||
|
||
CREATE PROCEDURE [dbo].[UniqueCoupons_DeleteByPromotionId] | ||
( | ||
@PromotionId INT | ||
) | ||
AS | ||
BEGIN | ||
DELETE FROM UniqueCoupons | ||
WHERE PromotionId = @PromotionId | ||
END | ||
GO | ||
|
||
CREATE PROCEDURE [dbo].[UniqueCoupons_GetById] | ||
( | ||
@Id BIGINT | ||
) | ||
AS | ||
BEGIN | ||
SELECT * FROM UniqueCoupons | ||
WHERE Id = @Id | ||
END | ||
GO | ||
|
||
CREATE PROCEDURE [dbo].[UniqueCoupons_GetByPromotionId] | ||
( | ||
@PromotionId INT | ||
) | ||
AS | ||
BEGIN | ||
SELECT * FROM UniqueCoupons | ||
WHERE PromotionId = @PromotionId | ||
END | ||
GO | ||
|
||
CREATE PROCEDURE [dbo].[UniqueCoupons_Save] | ||
( | ||
@Data dbo.[udttUniqueCoupons] readonly | ||
) | ||
AS | ||
BEGIN | ||
MERGE dbo.UniqueCoupons AS TARGET | ||
USING @Data AS SOURCE | ||
On (TARGET.Id = SOURCE.Id) | ||
WHEN MATCHED THEN | ||
UPDATE SET PromotionId = SOURCE.PromotionId, | ||
Code = SOURCE.Code, | ||
Valid = SOURCE.Valid, | ||
Expiration = SOURCE.Expiration, | ||
CustomerId = SOURCE.CustomerId, | ||
Created = SOURCE.Created, | ||
MaxRedemptions = SOURCE.MaxRedemptions, | ||
UsedRedemptions = SOURCE.UsedRedemptions | ||
|
||
WHEN NOT MATCHED THEN | ||
INSERT (PromotionId, Code, Valid, Expiration, CustomerId, Created, MaxRedemptions, UsedRedemptions) | ||
VALUES (SOURCE.PromotionId, SOURCE.Code, SOURCE.Valid, SOURCE.Expiration, SOURCE.CustomerId, SOURCE.Created, SOURCE.MaxRedemptions, SOURCE.UsedRedemptions); | ||
END | ||
GO | ||
|
||
|
||
SET ANSI_NULLS ON | ||
GO | ||
SET QUOTED_IDENTIFIER OFF | ||
GO | ||
|
||
Create PROCEDURE [dbo].[UniqueCoupons_DeleteExpiredCoupons] | ||
AS | ||
BEGIN | ||
DELETE FROM UniqueCoupons | ||
WHERE Expiration < GETDATE() | ||
END |
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 @@ | ||
{ | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft": "Warning", | ||
"Microsoft.Hosting.Lifetime": "Information", | ||
"EPiServer.Commerce": "Debug" | ||
} | ||
}, | ||
"AllowedHosts": "*", | ||
"ConnectionStrings": { | ||
"EPiServerDB": "Data Source=.;Database=netcore.qs.Cms;User Id=netcoreUser;Password=epi#Server7Local;MultipleActiveResultSets=True" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
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 @@ | ||
0.0.1 |
Binary file not shown.
Oops, something went wrong.