-
Notifications
You must be signed in to change notification settings - Fork 866
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
79 changed files
with
931 additions
and
496 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
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,150 @@ | ||
IF NOT EXISTS (SELECT * | ||
FROM INFORMATION_SCHEMA.TABLES | ||
WHERE TABLE_SCHEMA = 'dbo' | ||
AND TABLE_NAME = 'ArticleTypeRelation') | ||
BEGIN | ||
CREATE TABLE [dbo].[ArticleTypeRelation]( | ||
[ArticleId] [nvarchar](100) NOT NULL, | ||
[ArticleTypeId] [nvarchar](100) NOT NULL, | ||
CONSTRAINT [PK_ArticleTypeRelation] PRIMARY KEY CLUSTERED | ||
( | ||
[ArticleId] ASC, | ||
[ArticleTypeId] ASC | ||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] | ||
) ON [PRIMARY] | ||
END | ||
GO | ||
TRUNCATE TABLE [dbo].[ArticleTypeRelation] | ||
GO | ||
INSERT INTO [dbo].[ArticleTypeRelation] (ArticleId, ArticleTypeId) | ||
SELECT DISTINCT ISNULL(ContentID,ID),ArticleTypeID FROM dbo.[Article] | ||
GO | ||
|
||
IF NOT EXISTS (SELECT * | ||
FROM INFORMATION_SCHEMA.TABLES | ||
WHERE TABLE_SCHEMA = 'dbo' | ||
AND TABLE_NAME = 'CMS_WidgetArticleTypeRelation') | ||
BEGIN | ||
CREATE TABLE [dbo].[CMS_WidgetArticleTypeRelation]( | ||
[WidgetId] [nvarchar](100) NOT NULL, | ||
[ArticleTypeId] [int] NOT NULL, | ||
CONSTRAINT [PK_CMS_WidgetArticleTypeRelation] PRIMARY KEY CLUSTERED | ||
( | ||
[WidgetId] ASC, | ||
[ArticleTypeId] ASC | ||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] | ||
) ON [PRIMARY] | ||
END | ||
GO | ||
TRUNCATE TABLE dbo.CMS_WidgetArticleTypeRelation | ||
GO | ||
INSERT INTO [dbo].[CMS_WidgetArticleTypeRelation](WidgetId,ArticleTypeId) | ||
SELECT T0.ID, T1.ID FROM dbo.ArticleListWidget T0 | ||
INNER JOIN dbo.ArticleType T1 ON T0.ArticleTypeID = T1.ID OR T0.ArticleTypeID =T1.ParentID | ||
UNION | ||
SELECT T0.ID, T1.ID FROM dbo.ArticleTopWidget T0 | ||
INNER JOIN dbo.ArticleType T1 ON T0.ArticleTypeID = T1.ID OR T0.ArticleTypeID =T1.ParentID | ||
UNION | ||
SELECT T0.ID, T1.ID FROM dbo.ArticleTypeWidget T0 | ||
INNER JOIN dbo.ArticleType T1 ON T0.ArticleTypeID = T1.ID OR T0.ArticleTypeID = T1.ParentID | ||
GO | ||
|
||
|
||
IF NOT EXISTS (SELECT * | ||
FROM INFORMATION_SCHEMA.TABLES | ||
WHERE TABLE_SCHEMA = 'dbo' | ||
AND TABLE_NAME = 'ProductCategoryRelation') | ||
BEGIN | ||
CREATE TABLE [dbo].[ProductCategoryRelation]( | ||
[ProductId] [nvarchar](100) NOT NULL, | ||
[ProductCategoryId] [nvarchar](100) NOT NULL, | ||
CONSTRAINT [PK_ProductCategoryRelation] PRIMARY KEY CLUSTERED | ||
( | ||
[ProductId] ASC, | ||
[ProductCategoryId] ASC | ||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] | ||
) ON [PRIMARY] | ||
END | ||
GO | ||
TRUNCATE TABLE [dbo].[ProductCategoryRelation] | ||
GO | ||
INSERT INTO [dbo].[ProductCategoryRelation] (ProductId, ProductCategoryId) | ||
SELECT DISTINCT ISNULL(ContentID,ID), ProductCategoryID FROM dbo.[Product] | ||
GO | ||
|
||
IF NOT EXISTS (SELECT * | ||
FROM INFORMATION_SCHEMA.TABLES | ||
WHERE TABLE_SCHEMA = 'dbo' | ||
AND TABLE_NAME = 'CMS_WidgetProductCategoryRelation') | ||
BEGIN | ||
CREATE TABLE [dbo].[CMS_WidgetProductCategoryRelation]( | ||
[WidgetId] [nvarchar](100) NOT NULL, | ||
[ProductCategoryId] [int] NOT NULL, | ||
CONSTRAINT [PK_CMS_WidgetProductCategoryRelation] PRIMARY KEY CLUSTERED | ||
( | ||
[WidgetId] ASC, | ||
[ProductCategoryId] ASC | ||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] | ||
) ON [PRIMARY] | ||
END | ||
GO | ||
TRUNCATE TABLE dbo.[CMS_WidgetProductCategoryRelation] | ||
GO | ||
INSERT INTO [dbo].[CMS_WidgetProductCategoryRelation](WidgetId, ProductCategoryId) | ||
SELECT T0.ID, T1.ID FROM dbo.ProductListWidget T0 | ||
INNER JOIN dbo.ProductCategory T1 ON T0.ProductCategoryID = T1.ID OR T0.ProductCategoryID =T1.ParentID | ||
UNION | ||
SELECT T0.ID, T1.ID FROM dbo.ProductCategoryWidget T0 | ||
INNER JOIN dbo.ProductCategory T1 ON T0.ProductCategoryID = T1.ID OR T0.ProductCategoryID = T1.ParentID | ||
GO | ||
|
||
IF NOT EXISTS (SELECT * | ||
FROM INFORMATION_SCHEMA.TABLES | ||
WHERE TABLE_SCHEMA = 'dbo' | ||
AND TABLE_NAME = 'VideoTypeRelation') | ||
BEGIN | ||
CREATE TABLE [dbo].[VideoTypeRelation]( | ||
[VideoId] [nvarchar](100) NOT NULL, | ||
[VideoTypeId] [nvarchar](100) NOT NULL, | ||
CONSTRAINT [PK_VideoTypeRelation] PRIMARY KEY CLUSTERED | ||
( | ||
[VideoId] ASC, | ||
[VideoTypeId] ASC | ||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] | ||
) ON [PRIMARY] | ||
END | ||
GO | ||
TRUNCATE TABLE [dbo].[VideoTypeRelation] | ||
GO | ||
INSERT INTO [dbo].[VideoTypeRelation] (VideoId, VideoTypeId) | ||
SELECT DISTINCT ISNULL(ContentID,ID),VideoTypeID FROM dbo.[Video] | ||
GO | ||
|
||
IF NOT EXISTS (SELECT * | ||
FROM INFORMATION_SCHEMA.TABLES | ||
WHERE TABLE_SCHEMA = 'dbo' | ||
AND TABLE_NAME = 'CMS_WidgetVideoTypeRelation') | ||
BEGIN | ||
CREATE TABLE [dbo].[CMS_WidgetVideoTypeRelation]( | ||
[WidgetId] [nvarchar](100) NOT NULL, | ||
[VideoTypeId] [int] NOT NULL, | ||
CONSTRAINT [PK_CMS_WidgetVideoTypeRelation] PRIMARY KEY CLUSTERED | ||
( | ||
[WidgetId] ASC, | ||
[VideoTypeId] ASC | ||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] | ||
) ON [PRIMARY] | ||
END | ||
GO | ||
TRUNCATE TABLE dbo.CMS_WidgetVideoTypeRelation | ||
GO | ||
INSERT INTO [dbo].[CMS_WidgetVideoTypeRelation](WidgetId,VideoTypeId) | ||
SELECT T0.ID, T1.ID FROM dbo.VideoListWidget T0 | ||
INNER JOIN dbo.VideoType T1 ON T0.VideoTypeID = T1.ID OR T0.VideoTypeID =T1.ParentID | ||
UNION | ||
SELECT T0.ID, T1.ID FROM dbo.VideoTopWidget T0 | ||
INNER JOIN dbo.VideoType T1 ON T0.VideoTypeID = T1.ID OR T0.VideoTypeID =T1.ParentID | ||
UNION | ||
SELECT T0.ID, T1.ID FROM dbo.VideoTypeWidget T0 | ||
INNER JOIN dbo.VideoType T1 ON T0.VideoTypeID = T1.ID OR T0.VideoTypeID = T1.ParentID | ||
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,83 @@ | ||
CREATE TABLE IF NOT EXISTS `ArticleTypeRelation` ( | ||
`ArticleId` VARCHAR(100) NOT NULL, | ||
`ArticleTypeId` VARCHAR(100) NOT NULL, | ||
PRIMARY KEY (`ArticleId`, `ArticleTypeId`) | ||
); | ||
|
||
DELETE FROM `ArticleTypeRelation`; | ||
|
||
INSERT INTO `ArticleTypeRelation` (ArticleId, ArticleTypeId) | ||
SELECT DISTINCT IFNULL(ContentID, ID), ArticleTypeID FROM `Article`; | ||
|
||
CREATE TABLE IF NOT EXISTS `CMS_WidgetArticleTypeRelation` ( | ||
`WidgetId` VARCHAR(100) NOT NULL, | ||
`ArticleTypeId` INT NOT NULL, | ||
PRIMARY KEY (`WidgetId`, `ArticleTypeId`) | ||
); | ||
|
||
DELETE FROM `CMS_WidgetArticleTypeRelation`; | ||
|
||
INSERT INTO `CMS_WidgetArticleTypeRelation` (WidgetId, ArticleTypeId) | ||
SELECT T0.ID, T1.ID FROM `ArticleListWidget` T0 | ||
INNER JOIN `ArticleType` T1 ON T0.ArticleTypeID = T1.ID OR T0.ArticleTypeID = T1.ParentID | ||
UNION | ||
SELECT T0.ID, T1.ID FROM `ArticleTopWidget` T0 | ||
INNER JOIN `ArticleType` T1 ON T0.ArticleTypeID = T1.ID OR T0.ArticleTypeID = T1.ParentID | ||
UNION | ||
SELECT T0.ID, T1.ID FROM `ArticleTypeWidget` T0 | ||
INNER JOIN `ArticleType` T1 ON T0.ArticleTypeID = T1.ID OR T0.ArticleTypeID = T1.ParentID; | ||
|
||
CREATE TABLE IF NOT EXISTS `ProductCategoryRelation` ( | ||
`ProductId` VARCHAR(100) NOT NULL, | ||
`ProductCategoryId` VARCHAR(100) NOT NULL, | ||
PRIMARY KEY (`ProductId`, `ProductCategoryId`) | ||
); | ||
|
||
DELETE FROM `ProductCategoryRelation`; | ||
|
||
INSERT INTO `ProductCategoryRelation` (ProductId, ProductCategoryId) | ||
SELECT DISTINCT IFNULL(ContentID, ID), ProductCategoryID FROM `Product`; | ||
|
||
CREATE TABLE IF NOT EXISTS `CMS_WidgetProductCategoryRelation` ( | ||
`WidgetId` VARCHAR(100) NOT NULL, | ||
`ProductCategoryId` INT NOT NULL, | ||
PRIMARY KEY (`WidgetId`, `ProductCategoryId`) | ||
); | ||
|
||
DELETE FROM `CMS_WidgetProductCategoryRelation`; | ||
|
||
INSERT INTO `CMS_WidgetProductCategoryRelation` (WidgetId, ProductCategoryId) | ||
SELECT T0.ID, T1.ID FROM `ProductListWidget` T0 | ||
INNER JOIN `ProductCategory` T1 ON T0.ProductCategoryID = T1.ID OR T0.ProductCategoryID = T1.ParentID | ||
UNION | ||
SELECT T0.ID, T1.ID FROM `ProductCategoryWidget` T0 | ||
INNER JOIN `ProductCategory` T1 ON T0.ProductCategoryID = T1.ID OR T0.ProductCategoryID = T1.ParentID; | ||
|
||
CREATE TABLE IF NOT EXISTS `VideoTypeRelation` ( | ||
`VideoId` VARCHAR(100) NOT NULL, | ||
`VideoTypeId` VARCHAR(100) NOT NULL, | ||
PRIMARY KEY (`VideoId`, `VideoTypeId`) | ||
); | ||
|
||
DELETE FROM `VideoTypeRelation`; | ||
|
||
INSERT INTO `VideoTypeRelation` (VideoId, VideoTypeId) | ||
SELECT DISTINCT IFNULL(ContentID, ID), VideoTypeID FROM `Video`; | ||
|
||
CREATE TABLE IF NOT EXISTS `CMS_WidgetVideoTypeRelation` ( | ||
`WidgetId` VARCHAR(100) NOT NULL, | ||
`VideoTypeId` INT NOT NULL, | ||
PRIMARY KEY (`WidgetId`, `VideoTypeId`) | ||
); | ||
|
||
DELETE FROM `CMS_WidgetVideoTypeRelation`; | ||
|
||
INSERT INTO `CMS_WidgetVideoTypeRelation` (WidgetId, VideoTypeId) | ||
SELECT T0.ID, T1.ID FROM `VideoListWidget` T0 | ||
INNER JOIN `VideoType` T1 ON T0.VideoTypeID = T1.ID OR T0.VideoTypeID = T1.ParentID | ||
UNION | ||
SELECT T0.ID, T1.ID FROM `VideoTopWidget` T0 | ||
INNER JOIN `VideoType` T1 ON T0.VideoTypeID = T1.ID OR T0.VideoTypeID = T1.ParentID | ||
UNION | ||
SELECT T0.ID, T1.ID FROM `VideoTypeWidget` T0 | ||
INNER JOIN `VideoType` T1 ON T0.VideoTypeID = T1.ID OR T0.VideoTypeID = T1.ParentID; |
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,83 @@ | ||
CREATE TABLE IF NOT EXISTS ArticleTypeRelation ( | ||
ArticleId TEXT NOT NULL, | ||
ArticleTypeId TEXT NOT NULL, | ||
PRIMARY KEY (ArticleId, ArticleTypeId) | ||
); | ||
|
||
DELETE FROM ArticleTypeRelation; | ||
|
||
INSERT INTO ArticleTypeRelation (ArticleId, ArticleTypeId) | ||
SELECT DISTINCT IFNULL(ContentID, ID), ArticleTypeID FROM Article; | ||
|
||
CREATE TABLE IF NOT EXISTS CMS_WidgetArticleTypeRelation ( | ||
WidgetId TEXT NOT NULL, | ||
ArticleTypeId INTEGER NOT NULL, | ||
PRIMARY KEY (WidgetId, ArticleTypeId) | ||
); | ||
|
||
DELETE FROM CMS_WidgetArticleTypeRelation; | ||
|
||
INSERT INTO CMS_WidgetArticleTypeRelation (WidgetId, ArticleTypeId) | ||
SELECT T0.ID, T1.ID FROM ArticleListWidget T0 | ||
INNER JOIN ArticleType T1 ON T0.ArticleTypeID = T1.ID OR T0.ArticleTypeID = T1.ParentID | ||
UNION | ||
SELECT T0.ID, T1.ID FROM ArticleTopWidget T0 | ||
INNER JOIN ArticleType T1 ON T0.ArticleTypeID = T1.ID OR T0.ArticleTypeID = T1.ParentID | ||
UNION | ||
SELECT T0.ID, T1.ID FROM ArticleTypeWidget T0 | ||
INNER JOIN ArticleType T1 ON T0.ArticleTypeID = T1.ID OR T0.ArticleTypeID = T1.ParentID; | ||
|
||
CREATE TABLE IF NOT EXISTS ProductCategoryRelation ( | ||
ProductId TEXT NOT NULL, | ||
ProductCategoryId TEXT NOT NULL, | ||
PRIMARY KEY (ProductId, ProductCategoryId) | ||
); | ||
|
||
DELETE FROM ProductCategoryRelation; | ||
|
||
INSERT INTO ProductCategoryRelation (ProductId, ProductCategoryId) | ||
SELECT DISTINCT IFNULL(ContentID, ID), ProductCategoryID FROM Product; | ||
|
||
CREATE TABLE IF NOT EXISTS CMS_WidgetProductCategoryRelation ( | ||
WidgetId TEXT NOT NULL, | ||
ProductCategoryId INTEGER NOT NULL, | ||
PRIMARY KEY (WidgetId, ProductCategoryId) | ||
); | ||
|
||
DELETE FROM CMS_WidgetProductCategoryRelation; | ||
|
||
INSERT INTO CMS_WidgetProductCategoryRelation (WidgetId, ProductCategoryId) | ||
SELECT T0.ID, T1.ID FROM ProductListWidget T0 | ||
INNER JOIN ProductCategory T1 ON T0.ProductCategoryID = T1.ID OR T0.ProductCategoryID = T1.ParentID | ||
UNION | ||
SELECT T0.ID, T1.ID FROM ProductCategoryWidget T0 | ||
INNER JOIN ProductCategory T1 ON T0.ProductCategoryID = T1.ID OR T0.ProductCategoryID = T1.ParentID; | ||
|
||
CREATE TABLE IF NOT EXISTS VideoTypeRelation ( | ||
VideoId TEXT NOT NULL, | ||
VideoTypeId TEXT NOT NULL, | ||
PRIMARY KEY (VideoId, VideoTypeId) | ||
); | ||
|
||
DELETE FROM VideoTypeRelation; | ||
|
||
INSERT INTO VideoTypeRelation (VideoId, VideoTypeId) | ||
SELECT DISTINCT IFNULL(ContentID, ID), VideoTypeID FROM Video; | ||
|
||
CREATE TABLE IF NOT EXISTS CMS_WidgetVideoTypeRelation ( | ||
WidgetId TEXT NOT NULL, | ||
VideoTypeId INTEGER NOT NULL, | ||
PRIMARY KEY (WidgetId, VideoTypeId) | ||
); | ||
|
||
DELETE FROM CMS_WidgetVideoTypeRelation; | ||
|
||
INSERT INTO CMS_WidgetVideoTypeRelation (WidgetId, VideoTypeId) | ||
SELECT T0.ID, T1.ID FROM VideoListWidget T0 | ||
INNER JOIN VideoType T1 ON T0.VideoTypeID = T1.ID OR T0.VideoTypeID = T1.ParentID | ||
UNION | ||
SELECT T0.ID, T1.ID FROM VideoTopWidget T0 | ||
INNER JOIN VideoType T1 ON T0.VideoTypeID = T1.ID OR T0.VideoTypeID = T1.ParentID | ||
UNION | ||
SELECT T0.ID, T1.ID FROM VideoTypeWidget T0 | ||
INNER JOIN VideoType T1 ON T0.VideoTypeID = T1.ID OR T0.VideoTypeID = T1.ParentID; |
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
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
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 @@ | ||
/* http://www.zkea.net/ | ||
* Copyright (c) ZKEASOFT. All rights reserved. | ||
* http://www.zkea.net/licenses */ | ||
|
||
using Easy.Serializer; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Easy.Extend | ||
{ | ||
public static class ExtObject | ||
{ | ||
public static T Clone<T>(this T obj) where T : class | ||
{ | ||
return JsonConverter.Deserialize<T>(JsonConverter.Serialize(obj)); | ||
} | ||
} | ||
} |
Oops, something went wrong.