📄 cs_procedures.sql
字号:
exec sp_ExecuteSQL @STRSQL
END
--## END Schema Patch ##
Insert into cs_SchemaVersion(Major, Minor, Patch, InstallDate) values (@Major, @Minor, @Patch, GetDate())
Print 'Schema Patch v' + Convert(Varchar(2),@Major) + '.' + Convert(Varchar(2),@Minor) + '.' + Convert(Varchar(3),@Patch) + ' was applied successfully '
END
ELSE IF(@Installed is not null)
BEGIN
Print 'Schema Patch v' + Convert(Varchar(2),@Major) + '.' + Convert(Varchar(2),@Minor) + '.' + Convert(Varchar(3),@Patch) + ' was already applied on ' + Convert(varchar(50), @Installed)
END
ELSE
BEGIN
Print 'The patch could not be applied because your current schema is missing previous updates (Schema Patch v' + Convert(Varchar(2),@Major) + '.' + Convert(Varchar(2),@Minor) + '.' + Convert(Varchar(3),@Patch) + ')'
END
/***********************************************
* Patch: cs_Schema_Patch_2.1.17
* File Date: 8/8/2006 10:57:08 AM
***********************************************/
Print 'Creating...cs_Schema_Patch_2.1.17'
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
DECLARE @Major int, @Minor int, @Patch int, @Installed DateTime, @Prereqs int
Set @Major = 2;
Set @Minor = 1;
Set @Patch = 17;
Select @Prereqs = isnull(Count(InstallDate),0) from cs_SchemaVersion where Major=@Major and Minor=@Minor and Patch<@Patch
Select @Installed = InstallDate from cs_SchemaVersion where Major=@Major and Minor=@Minor and Patch=@Patch
If(@Installed is null AND @Prereqs = @Patch)
BEGIN
--## Schema Patch ##
-- patch sql removed, but left in so versions won't cause errors
--## END Schema Patch ##
Insert into cs_SchemaVersion(Major, Minor, Patch, InstallDate) values (@Major, @Minor, @Patch, GetDate())
Print 'Schema Patch v' + Convert(Varchar(2),@Major) + '.' + Convert(Varchar(2),@Minor) + '.' + Convert(Varchar(3),@Patch) + ' was applied successfully '
END
ELSE IF(@Installed is not null)
BEGIN
Print 'Schema Patch v' + Convert(Varchar(2),@Major) + '.' + Convert(Varchar(2),@Minor) + '.' + Convert(Varchar(3),@Patch) + ' was already applied on ' + Convert(varchar(50), @Installed)
END
ELSE
BEGIN
Print 'The patch could not be applied because your current schema is missing previous updates (Schema Patch v' + Convert(Varchar(2),@Major) + '.' + Convert(Varchar(2),@Minor) + '.' + Convert(Varchar(3),@Patch) + ')'
END
/***********************************************
* Patch: cs_Schema_Patch_2.1.18
* File Date: 8/8/2006 10:57:08 AM
***********************************************/
Print 'Creating...cs_Schema_Patch_2.1.18'
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
DECLARE @Major int, @Minor int, @Patch int, @Installed DateTime, @Prereqs int
Set @Major = 2;
Set @Minor = 1;
Set @Patch = 18;
Select @Prereqs = isnull(Count(InstallDate),0) from cs_SchemaVersion where Major=@Major and Minor=@Minor and Patch<@Patch
Select @Installed = InstallDate from cs_SchemaVersion where Major=@Major and Minor=@Minor and Patch=@Patch
If(@Installed is null AND @Prereqs = @Patch)
BEGIN
--## Schema Patch ##
/***************************************** This has been moved to an addon ********************************************
IF EXISTS (SELECT * FROM sysindexes WHERE id = OBJECT_ID(N'[dbo].[cs_RssCtrlPost]') AND name = N'IX_cs_RssCtrlPost_2')
exec sp_ExecuteSQL N'DROP INDEX [dbo].[cs_RssCtrlPost].[IX_cs_RssCtrlPost_2]'
***************************************** This has been moved to an addon ********************************************/
--## END Schema Patch ##
Insert into cs_SchemaVersion(Major, Minor, Patch, InstallDate) values (@Major, @Minor, @Patch, GetDate())
Print 'Schema Patch v' + Convert(Varchar(2),@Major) + '.' + Convert(Varchar(2),@Minor) + '.' + Convert(Varchar(3),@Patch) + ' was applied successfully '
END
ELSE IF(@Installed is not null)
BEGIN
Print 'Schema Patch v' + Convert(Varchar(2),@Major) + '.' + Convert(Varchar(2),@Minor) + '.' + Convert(Varchar(3),@Patch) + ' was already applied on ' + Convert(varchar(50), @Installed)
END
ELSE
BEGIN
Print 'The patch could not be applied because your current schema is missing previous updates (Schema Patch v' + Convert(Varchar(2),@Major) + '.' + Convert(Varchar(2),@Minor) + '.' + Convert(Varchar(3),@Patch) + ')'
END
/***********************************************
* Patch: cs_Schema_Patch_2.1.19
* File Date: 8/8/2006 10:57:09 AM
***********************************************/
Print 'Creating...cs_Schema_Patch_2.1.19'
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
DECLARE @Major int, @Minor int, @Patch int, @Installed DateTime, @Prereqs int
Set @Major = 2;
Set @Minor = 1;
Set @Patch = 19;
Select @Prereqs = isnull(Count(InstallDate),0) from cs_SchemaVersion where Major=@Major and Minor=@Minor and Patch<@Patch
Select @Installed = InstallDate from cs_SchemaVersion where Major=@Major and Minor=@Minor and Patch=@Patch
If(@Installed is null AND @Prereqs = @Patch)
BEGIN
--## Schema Patch ##
-- Polls (within forums)
exec sp_ExecuteSQL N'UPDATE cs_Posts SET PostMedia = 8 WHERE PostType = 2 OR (ApplicationPostType = 2 and SectionID in (select SectionID from cs_Sections where ApplicationType = 0))'
--## END Schema Patch ##
Insert into cs_SchemaVersion(Major, Minor, Patch, InstallDate) values (@Major, @Minor, @Patch, GetDate())
Print 'Schema Patch v' + Convert(Varchar(2),@Major) + '.' + Convert(Varchar(2),@Minor) + '.' + Convert(Varchar(3),@Patch) + ' was applied successfully '
END
ELSE IF(@Installed is not null)
BEGIN
Print 'Schema Patch v' + Convert(Varchar(2),@Major) + '.' + Convert(Varchar(2),@Minor) + '.' + Convert(Varchar(3),@Patch) + ' was already applied on ' + Convert(varchar(50), @Installed)
END
ELSE
BEGIN
Print 'The patch could not be applied because your current schema is missing previous updates (Schema Patch v' + Convert(Varchar(2),@Major) + '.' + Convert(Varchar(2),@Minor) + '.' + Convert(Varchar(3),@Patch) + ')'
END
/***********************************************
* Patch: cs_Schema_Patch_2.1.20
* File Date: 8/8/2006 10:57:09 AM
***********************************************/
Print 'Creating...cs_Schema_Patch_2.1.20'
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
DECLARE @Major int, @Minor int, @Patch int, @Installed DateTime, @Prereqs int
Set @Major = 2;
Set @Minor = 1;
Set @Patch = 20;
Select @Prereqs = isnull(Count(InstallDate),0) from cs_SchemaVersion where Major=@Major and Minor=@Minor and Patch<@Patch
Select @Installed = InstallDate from cs_SchemaVersion where Major=@Major and Minor=@Minor and Patch=@Patch
If(@Installed is null AND @Prereqs = @Patch)
BEGIN
--## Schema Patch ##
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[PK_cs_PostReindexQueue]') and OBJECTPROPERTY(id, N'IsPrimaryKey') = 1)
exec sp_ExecuteSQL N'ALTER TABLE [dbo].[cs_PostReindexQueue] DROP CONSTRAINT [PK_cs_PostReindexQueue]'
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[cs_PostReindexQueue]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
exec sp_ExecuteSQL N'DROP TABLE [dbo].[cs_PostReindexQueue]'
--## END Schema Patch ##
Insert into cs_SchemaVersion(Major, Minor, Patch, InstallDate) values (@Major, @Minor, @Patch, GetDate())
Print 'Schema Patch v' + Convert(Varchar(2),@Major) + '.' + Convert(Varchar(2),@Minor) + '.' + Convert(Varchar(3),@Patch) + ' was applied successfully '
END
ELSE IF(@Installed is not null)
BEGIN
Print 'Schema Patch v' + Convert(Varchar(2),@Major) + '.' + Convert(Varchar(2),@Minor) + '.' + Convert(Varchar(3),@Patch) + ' was already applied on ' + Convert(varchar(50), @Installed)
END
ELSE
BEGIN
Print 'The patch could not be applied because your current schema is missing previous updates (Schema Patch v' + Convert(Varchar(2),@Major) + '.' + Convert(Varchar(2),@Minor) + '.' + Convert(Varchar(3),@Patch) + ')'
END
/***********************************************
* Patch: cs_Schema_Patch_2.1.21
* File Date: 8/8/2006 10:57:09 AM
***********************************************/
Print 'Creating...cs_Schema_Patch_2.1.21'
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
DECLARE @Major int, @Minor int, @Patch int, @Installed DateTime, @Prereqs int
Set @Major = 2;
Set @Minor = 1;
Set @Patch = 21;
Select @Prereqs = isnull(Count(InstallDate),0) from cs_SchemaVersion where Major=@Major and Minor=@Minor and Patch<@Patch
Select @Installed = InstallDate from cs_SchemaVersion where Major=@Major and Minor=@Minor and Patch=@Patch
If(@Installed is null AND @Prereqs = @Patch)
BEGIN
--## Schema Patch ##
exec sp_ExecuteSQL N'ALTER TABLE [dbo].[cs_UserProfile] ADD AllowSiteToContact bit NOT NULL CONSTRAINT DF_cs_UserProfile_AllowSiteToContact DEFAULT 0'
exec sp_ExecuteSQL N'ALTER TABLE [dbo].[cs_UserProfile] ADD AllowSitePartnersToContact bit NOT NULL CONSTRAINT DF_cs_UserProfile_AllowSitePartnersToContact DEFAULT 0'
--## END Schema Patch ##
Insert into cs_SchemaVersion(Major, Minor, Patch, InstallDate) values (@Major, @Minor, @Patch, GetDate())
Print 'Schema Patch v' + Convert(Varchar(2),@Major) + '.' + Convert(Varchar(2),@Minor) + '.' + Convert(Varchar(3),@Patch) + ' was applied successfully '
END
ELSE IF(@Installed is not null)
BEGIN
Print 'Schema Patch v' + Convert(Varchar(2),@Major) + '.' + Convert(Varchar(2),@Minor) + '.' + Convert(Varchar(3),@Patch) + ' was already applied on ' + Convert(varchar(50), @Installed)
END
ELSE
BEGIN
Print 'The patch could not be applied because your current schema is missing previous updates (Schema Patch v' + Convert(Varchar(2),@Major) + '.' + Convert(Varchar(2),@Minor) + '.' + Convert(Varchar(3),@Patch) + ')'
END
/***********************************************
* Patch: cs_Schema_Patch_2.1.22
* File Date: 8/8/2006 10:57:09 AM
***********************************************/
Print 'Creating...cs_Schema_Patch_2.1.22'
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
DECLARE @Major int, @Minor int, @Patch int, @Installed DateTime, @Prereqs int
Set @Major = 2;
Set @Minor = 1;
Set @Patch = 22;
Select @Prereqs = isnull(Count(InstallDate),0) from cs_SchemaVersion where Major=@Major and Minor=@Minor and Patch<@Patch
Select @Installed = InstallDate from cs_SchemaVersion where Major=@Major and Minor=@Minor and Patch=@Patch
If(@Installed is null AND @Prereqs = @Patch)
BEGIN
--## Schema Patch ##
exec sp_ExecuteSQL N'ALTER TABLE [dbo].[cs_RollerBlogFeeds] ADD [SiteUrl] [nvarchar] (512) NULL'
exec sp_ExecuteSQL N'UPDATE [dbo].[cs_RollerBlogFeeds] Set SiteUrl = '''''
exec sp_ExecuteSQL N'ALTER TABLE [dbo].[cs_RollerBlogFeeds] ALTER COLUMN [SiteUrl] [nvarchar] (512) NOT NULL'
--## END Schema Patch ##
Insert into cs_SchemaVersion(Major, Minor, Patch, InstallDate) values (@Major, @Minor, @Patch, GetDate())
Print 'Schema Patch v' + Convert(Varchar(2),@Major) + '.' + Convert(Varchar(2),@Minor) + '.' + Convert(Varchar(3),@Patch) + ' was applied successfully '
END
ELSE IF(@Installed is not null)
BEGIN
Print 'Schema Patch v' + Convert(Varchar(2),@Major) + '.' + Convert(Varchar(2),@Minor) + '.' + Convert(Varchar(3),@Patch) + ' was already applied on ' + Convert(varchar(50), @Installed)
END
ELSE
BEGIN
Print 'The patch could not be applied because your current schema is missing previous updates (Schema Patch v' + Convert(Varchar(2),@Major) + '.' + Convert(Varchar(2),@Minor) + '.' + Convert(Varchar(3),@Patch) + ')'
END
/***********************************************
* Patch: cs_Schema_Patch_2.1.23
* File Date: 8/8/2006 10:57:09 AM
***********************************************/
Print 'Creating...cs_Schema_Patch_2.1.23'
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
DECLARE @Major int, @Minor int, @Patch int, @Installed DateTime, @Prereqs int
Set @Major = 2;
Set @Minor = 1;
Set @Patch = 23;
Select @Prereqs = isnull(Count(InstallDate),0) from cs_SchemaVersion where Major=@Major and Minor=@Minor and Patch<@Patch
Select @Installed = InstallDate from cs_SchemaVersion where Major=@Major and Minor=@Minor and Patch=@Patch
If(@Installed is null AND @Prereqs = @Patch)
BEGIN
--## Schema Patch ##
exec sp_ExecuteSQL N'Update cs_Posts set PostConfiguration = 55 from cs_Posts join cs_RollerBlogPost on cs_Posts.PostID = cs_RollerBlogPost.PostID where PostConfiguration & 16 <> 16'
--## END Schema Patch ##
Insert into cs_SchemaVersion(Major, Minor, Patch, InstallDate) values (@Major, @Minor, @Patch, GetDate())
Print 'Schema Patch v' + Convert(Varchar(2),@Major) + '.' + Convert(Varchar(2),@Minor) + '.' + Convert(Varchar(3),@Patch) + ' was applied successfully '
END
ELSE IF(@Installed is not null)
BEGIN
Print 'Schema Patch v' + Convert(Varchar(2),@Major) + '.' + Convert(Varchar(2),@Minor) + '.' + Convert(Varchar(3),@Patch) + ' was already applied on ' + Convert(varchar(50), @Installed)
END
ELSE
BEGIN
Print 'The patch could not be applied because your current schema is missing previous updates (Schema Patch v' + Convert(Varchar(2),@Major) + '.' + Convert(Varchar(2),@Minor) + '.' + Convert(Varchar(3),@Patch) + ')'
END
/***********************************************
* Patch: cs_Schema_Patch_2.1.24
* File Date: 8/8/2006 10:57:09 AM
***********************************************/
Print 'Creating...cs_Schema_Patch_2.1.24'
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
DECLARE @Major int, @Minor int, @Patch int, @Installed DateTime, @Prereqs int
Set @Major = 2;
Set @Minor = 1;
Set @Patch = 24;
Select @Prereqs = isnull(Count(InstallDate),0) from cs_SchemaVersion where Major=@Major and Minor=@Minor and Patch<@Patch
Select @Installed = InstallDate from cs_SchemaVersion where Major=@Major and Minor=@Minor and Patch=@Patch
If(@Installed is null AND @Prereqs = @Patch)
BEGIN
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -