⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cs_schema.sql

📁 community server 源码
💻 SQL
📖 第 1 页 / 共 5 页
字号:
	[LastAction] [nvarchar] (1024)  NULL CONSTRAINT [DF_cs_User_LastAction] DEFAULT ('')
	
)

IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[cs_Links]
(
[LinkID] [int] NOT NULL IDENTITY(1, 1),
[LinkCategoryID] [int] NOT NULL,
[Title] [nvarchar] (100) NULL,
[Url] [nvarchar] (255) NULL,
[IsEnabled] [bit] NOT NULL,
[SortOrder] [int] NOT NULL CONSTRAINT [DF_cs_Links_SortOrder] DEFAULT (0),
[SettingsID] [int], 
[Rel] [nvarchar] (100) NULL, 
[Description] [nvarchar] (2000) NULL,
[DateCreated] [datetime] NOT NULL CONSTRAINT [cs_Links_DateCreatedDefault] DEFAULT (getdate())
)

GO
IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[cs_statistics_Site]
(
[DateCreated] [datetime] NOT NULL CONSTRAINT [DF_cs_Statistics_DateCreated] DEFAULT (getdate()),
[TotalUsers] [int] NOT NULL,
[TotalPosts] [int] NOT NULL,
[TotalModerators] [int] NOT NULL,
[TotalModeratedPosts] [int] NOT NULL,
[TotalAnonymousUsers] [int] NOT NULL CONSTRAINT [DF_cs_Statistics_TotalAnonymousUsers] DEFAULT (0),
[TotalTopics] [int] NOT NULL,
[DaysPosts] [int] NOT NULL,
[DaysTopics] [int] NOT NULL,
[NewPostsInPast24Hours] [int] NOT NULL,
[NewThreadsInPast24Hours] [int] NOT NULL,
[NewUsersInPast24Hours] [int] NOT NULL,
[MostViewsPostID] [int] NOT NULL,
[MostActivePostID] [int] NOT NULL,
[MostActiveUserID] [int] NOT NULL,
[MostReadPostID] [int] NOT NULL,
[NewestUserID] [int] NOT NULL CONSTRAINT [DF_cs_statistics_Site_NewestUserID] DEFAULT (0),
[SettingsID] [int] NULL
)

GO
IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[cs_ThreadRating]
(
[UserID] [int] NOT NULL,
[ThreadID] [int] NOT NULL,
[Rating] [int] NOT NULL,
[SettingsID] [int] NULL,
[DateCreated] [datetime] NOT NULL CONSTRAINT [DF_cs_ThreadRating_DateCreated] DEFAULT (getdate())
)

GO
IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[cs_EmailQueue]
(
[EmailID] [uniqueidentifier] NOT NULL CONSTRAINT [DF_cs_EmailQueue_EmailID] DEFAULT (newid()),
[emailPriority] [int] NOT NULL,
[emailBodyFormat] [int] NOT NULL,
[emailTo] [nvarchar] (2000) NULL,
[emailCc] [ntext] NULL,
[emailBcc] [ntext] NULL,
[EmailFrom] [nvarchar] (256) NULL,
[EmailSubject] [nvarchar] (1024) NULL,
[EmailBody] [ntext] NULL,
[NextTryTime] [datetime] NOT NULL CONSTRAINT [DF_cs_EmailQueue_createdTimestamp] DEFAULT ('1/1/1979 12:00:00'),
[NumberOfTries] [int] NOT NULL CONSTRAINT [DF_cs_EmailQueue_NumberOfTries] DEFAULT (0),
[SettingsID] [int] NULL
)

GO
IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[cs_weblog_Weblogs]
(
[SectionID] [int] NOT NULL,
[MostRecentPostID] [int] NOT NULL CONSTRAINT [DF_cs_weblog_Weblogs_MostRecentPostID] DEFAULT (0),
[MostRecentPostDate] [datetime] NOT NULL CONSTRAINT [DF_cs_weblog_Weblogs_MostRecentPostDate] DEFAULT (getdate()),
[MostRecentPostName] [nvarchar] (256) NULL,
[MostRecentPostAuthorID] [int] NOT NULL CONSTRAINT [DF_cs_weblog_Weblogs_MostRecentPostAuthorID] DEFAULT (0),
[MostRecentPostAuthor] [nvarchar] (256) NULL CONSTRAINT [DF_cs_weblog_Weblogs_MostRecentPostAuthor] DEFAULT (''),
[MostRecentPostSubject] [nvarchar] (256) NULL CONSTRAINT [DF_cs_weblog_Weblogs_MostRecentPostSubject] DEFAULT (''),
[MostRecentArticleID] [int] NOT NULL CONSTRAINT [DF_cs_weblog_Weblogs_MostRecentArticleID] DEFAULT (0),
[MostRecentArticleDate] [datetime] NOT NULL CONSTRAINT [DF_cs_weblog_Weblogs_MostRecentArticleDate] DEFAULT (getdate()),
[MostRecentArticleName] [nvarchar] (256) NULL,
[MostRecentArticleAuthorID] [int] NOT NULL CONSTRAINT [DF_cs_weblog_Weblogs_MostRecentArticleAuthorID] DEFAULT (0),
[MostRecentArticleAuthor] [nvarchar] (256) NULL CONSTRAINT [DF_cs_weblog_Weblogs_MostRecentArticleAuthor] DEFAULT (''),
[MostRecentArticleSubject] [nvarchar] (256) NULL CONSTRAINT [DF_cs_weblog_Weblogs_MostRecentArticleSubject] DEFAULT (''),
[PostCount] [int] NOT NULL CONSTRAINT [cs_weblog_Weblogs_PC] DEFAULT (0),
[ArticleCount] [int] NOT NULL CONSTRAINT [DF_cs_weblog_Weblogs_AC] DEFAULT (0),
[CommentCount] [int] NOT NULL CONSTRAINT [cs_weblog_Weblogs_CC] DEFAULT (0),
[TrackbackCount] [int] NOT NULL CONSTRAINT [cs_weblog_Weblogs_TC] DEFAULT (0),
[SettingsID] [int] NULL
)

GO
IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[cs_Images]
(
[ImageID] [int] NOT NULL IDENTITY(1, 1),
[Length] [int] NOT NULL,
[ContentType] [nvarchar] (64) NULL,
[Content] [image] NOT NULL,
[DateLastUpdated] [datetime] NOT NULL CONSTRAINT [DF_cs_Images_DateLastUpdated] DEFAULT (getdate()),
[SettingsID] [int] NULL
)

GO
IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[cs_UserAvatar]
(
[UserID] [int] NOT NULL,
[ImageID] [int] NOT NULL,
[SettingsID] [int] NULL
)

GO
IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[cs_SectionsRead]
(
[GroupID] [int] NOT NULL CONSTRAINT [DF_cs_SectionsRead_GroupID] DEFAULT (0),
[SectionID] [int] NOT NULL,
[UserID] [int] NOT NULL,
[MarkReadAfter] [int] NOT NULL CONSTRAINT [DF_ForumsReadByDate_MarkReadAfter] DEFAULT (0),
[NewPosts] [bit] NOT NULL CONSTRAINT [DF_cs_SectionsRead_NewPosts] DEFAULT (1),
[LastActivity] [datetime] NOT NULL CONSTRAINT [DF_ForumsRead_LastActivity] DEFAULT (getdate()),
[SettingsID] [int] NULL
)

GO
IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[cs_ForumPingback]
(
[SectionID] [int] NOT NULL,
[Pingback] [nvarchar] (512) NULL,
[Count] [int] NOT NULL CONSTRAINT [DF_cs_ForumPingback_Count] DEFAULT (0),
[LastUpdated] [datetime] NOT NULL CONSTRAINT [DF_cs_ForumPingback_LastUpdated] DEFAULT (getdate()),
[SettingsID] [int] NULL
)

GO
IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[cs_AnonymousUsers]
(
[UserID] [char] (36) NULL,
[LastLogin] [datetime] NOT NULL CONSTRAINT [DF_AnonymousUsers_LastLogin] DEFAULT (getdate()),
[LastAction] [nvarchar] (1024) NULL CONSTRAINT [DF_cs_AnonymousUsers_LastAction] DEFAULT (''),
[SettingsID] [int] NULL
)

GO
IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[cs_TrackedThreads]
(
[ThreadID] [int] NOT NULL,
[UserID] [int] NULL,
[DateCreated] [datetime] NOT NULL CONSTRAINT [DF_ThreadTrackings_DateCreated] DEFAULT (getdate()),
[SettingsID] [int] NULL
)

GO
IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[cs_PostAttachments]
(
[PostID] [int] NOT NULL,
[SectionID] [int] NOT NULL,
[UserID] [int] NOT NULL CONSTRAINT [DF_cs_PostAttachments_UserID] DEFAULT (0),
[Created] [datetime] NOT NULL CONSTRAINT [DF_cs_PostAttachments_Created] DEFAULT (getdate()),
[FileName] [nvarchar] (1024) NULL,
[Content] [image] NOT NULL,
[ContentType] [nvarchar] (50) NULL,
[ContentSize] [int] NOT NULL,
[SettingsID] [int] NULL,
[FriendlyFileName] [nvarchar] (256) NULL,
[Height] [int] NOT NULL DEFAULT (0),
[Width] [int] NOT NULL DEFAULT (0),
[IsRemote] bit NOT NULL Constraint cs_PostAttachments_IsRemoteDefault default(0)
)

GO
IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO

GO
IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[cs_PostAttachments_TEMP]
(
[AttachmentID] [uniqueidentifier] NOT NULL ,
[SectionID] [int] NOT NULL,
[UserID] [int] NOT NULL,
[Created] [datetime] NOT NULL,
[FileName] [nvarchar] (1024) NULL,
[Content] [image] NOT NULL,
[ContentType] [nvarchar] (50) NULL,
[ContentSize] [int] NOT NULL,
[SettingsID] [int] NULL,
[IsRemote] bit NOT NULL,
[Height] [int] NOT NULL DEFAULT (0),
[Width] [int] NOT NULL DEFAULT (0),
[FriendlyFileName] nvarchar(256) NULL
)

GO
IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[cs_Post_Categories]
(
[CategoryID] [int] NOT NULL IDENTITY(1000, 1),
[SectionID] [int] NOT NULL,
[Name] [nvarchar] (256) NULL,
[IsEnabled] [bit] NOT NULL,
[ParentID] [int] NOT NULL CONSTRAINT [DF_forums_Categories_ParentID] DEFAULT (0),
[Description] [nvarchar] (2000) NULL,
[SettingsID] [int] NULL,
[Path] [nvarchar] (255) NOT NULL CONSTRAINT [DF_cs_Post_Categories_Path] DEFAULT ('/'),
[TotalThreads] [int] NOT NULL CONSTRAINT [DF_cs_Post_Categories_TotalThreads] DEFAULT(0),
[MostRecentPostDate] [datetime] NULL,
[TotalSubThreads] [int] NOT NULL CONSTRAINT [DF_cs_Post_Categories_TotalSubThreads] DEFAULT(0),
[MostRecentSubPostDate] [datetime] NULL,
[FeaturedPostID] [int] NULL,
[DateCreated] [datetime] NOT NULL CONSTRAINT [DF_cs_Post_Categories_DateCreated] DEFAULT( getdate() )
)

GO
IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE View [dbo].[cs_vw_EveryOne_Role]
as

SELECT jA.[LoweredApplicationName], jA.[ApplicationId], [RoleId], [RoleName], [LoweredRoleName], aspnet_Roles.[Description] 

FROM [dbo].[aspnet_Roles]
JOIN [dbo].[aspnet_Applications] jA on [dbo].aspnet_Roles.ApplicationId = jA.ApplicationId

Where LoweredRoleName = 'everyone'

GO
IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[cs_SiteSettings]
(
[SettingsID] [int] NOT NULL IDENTITY(1000, 1),
[Disabled] [bit] NOT NULL CONSTRAINT [DF_cs_SiteSettings_Enabled] DEFAULT (0),
[Version] [nvarchar] (64) NULL,
[SettingsXML] [ntext] NULL,
[SettingsKey] [uniqueidentifier] NULL,
[ApplicationName] [nvarchar] (256) NULL
	, CONSTRAINT PK_cs_SiteSettings PRIMARY KEY CLUSTERED (
		SettingsID
	)
)

GO
IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[cs_Exceptions]
(
[ExceptionID] [int] NOT NULL IDENTITY(1, 1),
[ExceptionHash] [varchar] (128) NULL,
[SettingsID] [int] NOT NULL,
[Category] [int] NOT NULL,
[Exception] [nvarchar] (2000) NULL,
[ExceptionMessage] [nvarchar] (500) NULL,
[IPAddress] [varchar] (15) NULL,
[UserAgent] [nvarchar] (64) NULL,
[HttpReferrer] [nvarchar] (256) NULL,
[HttpVerb] [nvarchar] (24) NULL,
[PathAndQuery] [nvarchar] (512) NULL,
[DateCreated] [datetime] NOT NULL CONSTRAINT [DF_cs_Exceptions_DateCreated] DEFAULT (getdate()),
[DateLastOccurred] [datetime] NOT NULL,
[Frequency] [int] NOT NULL CONSTRAINT [DF_cs_Exceptions_Frequency] DEFAULT (0)
)

GO
IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[cs_Services]
(
[ServiceID] [int] NOT NULL IDENTITY(1, 1),
[ServiceName] [nvarchar] (30) NULL,
[ServiceTypeCode] [int] NULL,
[ServiceAssemblyPath] [nvarchar] (256) NULL,
[ServiceFullClassName] [nvarchar] (256) NULL,
[ServiceWorkingDirectory] [nvarchar] (256) NULL,
[SettingsID] [int] NULL
)

GO
IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -