if exists (select * from dbo.sysobjects where id = object_id(N'[ad]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [ad]
GO

CREATE TABLE [ad] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[title] [varchar] (100) NULL ,
	[type] [int] NULL ,
	[updatetime] [datetime] NULL ,
	[speed] [int] NULL ,
	[click] [int] NULL ,
	[width] [int] NULL ,
	[height] [int] NULL ,
	[righter] [int] NULL ,
	[toper] [int] NULL ,
	[dating] [int] NULL ,
	[timing] [int] NULL ,
	[insertNews] [int] NULL ,
	[url] [varchar] (100) NULL ,
	[updateIp] [varchar] (100) NULL ,
	[bigClassId] [int] NULL ,
	[menuId] [int] NULL ,
	[gradeId] [int] NULL ,
	[gate] [int] NULL ,
	[userId] [int] NULL ,
	[isTop] [int] NULL ,
	[ordering] [int] NULL ,
	[passed] [int] NULL ,
	[showUrl] [varchar] (100) NULL ,
	[showClose] [int] NULL ,
	CONSTRAINT [PK_ad] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[Admin]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [Admin]
GO

CREATE TABLE [Admin] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[adminName] [varchar] (100) NULL ,
	[fullName] [varchar] (100) NULL ,
	[password] [varchar] (100) NULL ,
	[allowAllAssign] [int] NULL ,
	[allowEditOthersAdmin] [int] NULL ,
	[isEqualAdmin] [int] NULL ,
	[allowLogin] [int] NULL ,
	[isSbwAdmin] [int] NULL ,
	CONSTRAINT [Admin_PK] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[AdminAssign]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [AdminAssign]
GO

CREATE TABLE [AdminAssign] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[adminId] [int] NULL ,
	[menuId] [int] NULL ,
	CONSTRAINT [AdminAssign_PK] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[answer]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [answer]
GO

CREATE TABLE [answer] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[questionId] [int] NULL ,
	[optionsId] [int] NULL ,
	[userId] [int] NULL ,
	[IP] [bigint] NULL ,
	[date] [datetime] NULL ,
	[Message] [text] NULL ,
	[userName] [varchar] (100) NULL ,
	[IsSaved] [int] NULL CONSTRAINT [DF_answer_IsSaved] DEFAULT ((0)),
	CONSTRAINT [PK_ANSWER] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[artDesign]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [artDesign]
GO

CREATE TABLE [artDesign] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[name] [varchar] (2000) NULL ,
	[leftTopFrontImageVar] [varchar] (100) NULL ,
	[leftMiddleFrontImageVar] [varchar] (100) NULL ,
	[leftMiddleBackImageVar] [varchar] (100) NULL ,
	[leftVert] [varchar] (100) NULL ,
	[leftMiddleFrontWidth] [varchar] (100) NULL ,
	[leftMiddleFrontHeight] [varchar] (100) NULL ,
	[leftMiddleFrontLink] [varchar] (100) NULL ,
	[leftBottomFrontImageVar] [varchar] (100) NULL ,
	[centerTopFrontImageVar] [varchar] (100) NULL ,
	[centerTopBackImageVar] [varchar] (100) NULL ,
	[centerTopFrontWidth] [varchar] (100) NULL ,
	[centerTopFrontHeight] [varchar] (100) NULL ,
	[centerTopFrontLink] [varchar] (100) NULL ,
	[centerMiddleBackImageVar] [varchar] (100) NULL ,
	[itemImageVar] [varchar] (100) NULL ,
	[centerBottomBackImageVar] [varchar] (100) NULL ,
	[rightTopFrontImageVar] [varchar] (100) NULL ,
	[rightMiddleFrontImageVar] [varchar] (100) NULL ,
	[rightMiddleBackImageVar] [varchar] (100) NULL ,
	[rightVert] [varchar] (100) NULL ,
	[rightMiddleFrontWidth] [varchar] (100) NULL ,
	[rightMiddleFrontHeight] [varchar] (100) NULL ,
	[rightMiddleFrontLink] [varchar] (100) NULL ,
	[rightBottomFrontImageVar] [varchar] (100) NULL ,
	[fontPosition] [varchar] (100) NULL ,
	[color] [varchar] (100) NULL ,
	[size] [varchar] (100) NULL ,
	[space] [varchar] (100) NULL ,
	[font] [varchar] (100) NULL ,
	[bold] [varchar] (100) NULL ,
	[italic] [varchar] (100) NULL ,
	[topColor] [varchar] (100) NULL ,
	[middleColor] [varchar] (100) NULL ,
	[bottomColor] [varchar] (100) NULL ,
	[border] [varchar] (100) NULL ,
	[cellPad] [varchar] (100) NULL ,
	[cellSpace] [varchar] (100) NULL ,
	[brdrColor] [varchar] (100) NULL ,
	[centerBottomFrontImageVar] [varchar] (100) NULL ,
	[menuId] [int] NULL ,
	[centerTopBackHeight] [varchar] (100) NULL ,
	[middleTableBorderColor] [varchar] (100) NULL ,
	[middleTableBorderShow] [varchar] (100) NULL ,
	[releaseDateVar] [int] NOT NULL CONSTRAINT [DF__artDesign__relea__0425A276] DEFAULT ((0)),
	[releaseDepartmentVar] [int] NOT NULL CONSTRAINT [DF__artDesign__relea__0519C6AF] DEFAULT ((0)),
	[click] [int] NOT NULL CONSTRAINT [DF__artDesign__click__060DEAE8] DEFAULT ((0)),
	[newImageVar] [varchar] (100) NULL ,
	[topImageVar] [varchar] (100) NULL ,
	[showTopMoreInfo] [int] NOT NULL CONSTRAINT [DF__artDesign__showT__07020F21] DEFAULT ((0)),
	[topMoreInfoImageVar] [varchar] (100) NULL ,
	[showBottomMoreInfo] [int] NOT NULL CONSTRAINT [DF__artDesign__showB__07F6335A] DEFAULT ((0)),
	[bottomMoreInfoImageVar] [varchar] (100) NOT NULL CONSTRAINT [DF__artDesign__botto__08EA5793] DEFAULT ('more.gif'),
	[hotImageVar] [varchar] (100) NULL ,
	CONSTRAINT [PK_artDesign] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[artDesignTemplate]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [artDesignTemplate]
GO

CREATE TABLE [artDesignTemplate] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[name] [varchar] (500) NULL ,
	[leftTopFrontImageVar] [varchar] (100) NULL ,
	[leftMiddleFrontImageVar] [varchar] (100) NULL ,
	[leftMiddleBackImageVar] [varchar] (100) NULL ,
	[leftVert] [varchar] (100) NULL ,
	[leftMiddleFrontWidth] [varchar] (100) NULL ,
	[leftMiddleFrontHeight] [varchar] (100) NULL ,
	[leftMiddleFrontLink] [varchar] (100) NULL ,
	[leftBottomFrontImageVar] [varchar] (100) NULL ,
	[centerTopFrontImageVar] [varchar] (100) NULL ,
	[centerTopBackImageVar] [varchar] (100) NULL ,
	[centerTopFrontWidth] [varchar] (100) NULL ,
	[centerTopFrontHeight] [varchar] (100) NULL ,
	[centerTopFrontLink] [varchar] (100) NULL ,
	[centerMiddleBackImageVar] [varchar] (100) NULL ,
	[itemImageVar] [varchar] (100) NULL ,
	[centerBottomBackImageVar] [varchar] (100) NULL ,
	[rightTopFrontImageVar] [varchar] (100) NULL ,
	[rightMiddleFrontImageVar] [varchar] (100) NULL ,
	[rightMiddleBackImageVar] [varchar] (100) NULL ,
	[rightVert] [varchar] (100) NULL ,
	[rightMiddleFrontWidth] [varchar] (100) NULL ,
	[rightMiddleFrontHeight] [varchar] (100) NULL ,
	[rightMiddleFrontLink] [varchar] (100) NULL ,
	[rightBottomFrontImageVar] [varchar] (100) NULL ,
	[fontPosition] [varchar] (100) NULL ,
	[color] [varchar] (100) NULL ,
	[size] [varchar] (100) NULL ,
	[space] [varchar] (100) NULL ,
	[font] [varchar] (100) NULL ,
	[bold] [varchar] (100) NULL ,
	[italic] [varchar] (100) NULL ,
	[topColor] [varchar] (100) NULL ,
	[middleColor] [varchar] (100) NULL ,
	[bottomColor] [varchar] (100) NULL ,
	[border] [varchar] (100) NULL ,
	[cellPad] [varchar] (100) NULL ,
	[cellSpace] [varchar] (100) NULL ,
	[brdrColor] [varchar] (100) NULL ,
	[centerBottomFrontImageVar] [varchar] (100) NULL ,
	[centerTopBackHeight] [varchar] (100) NULL ,
	[middleTableBorderColor] [varchar] (100) NULL ,
	[middleTableBorderShow] [varchar] (100) NULL ,
	[releaseDateVar] [int] NOT NULL CONSTRAINT [DF__artDesign__relea__1AD3FDA4] DEFAULT ((0)),
	[releaseDepartmentVar] [int] NOT NULL CONSTRAINT [DF__artDesign__relea__1BC821DD] DEFAULT ((0)),
	[click] [int] NOT NULL CONSTRAINT [DF__artDesign__click__1CBC4616] DEFAULT ((0)),
	[newImageVar] [varchar] (100) NULL ,
	[topImageVar] [varchar] (100) NULL ,
	[showTopMoreInfo] [int] NOT NULL CONSTRAINT [DF__artDesign__showT__1DB06A4F] DEFAULT ((0)),
	[topMoreInfoImageVar] [varchar] (100) NULL ,
	[showBottomMoreInfo] [int] NOT NULL CONSTRAINT [DF__artDesign__showB__1EA48E88] DEFAULT ((0)),
	[bottomMoreInfoImageVar] [varchar] (100) NOT NULL CONSTRAINT [DF__artDesign__botto__1F98B2C1] DEFAULT ('more.gif'),
	[hotImageVar] [varchar] (100) NULL ,
	[zdyName] [varchar] (1000) NULL ,
	[artCode] [varchar] (100) NULL ,
	[artStyle] [varchar] (4000) NULL ,
	[artState] [int] NULL ,
	[isSystem] [int] NULL CONSTRAINT [DF_artDesignTemplate_isSystem] DEFAULT ((0)),
	CONSTRAINT [PK_artDesignTemplate] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[AspProperty]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [AspProperty]
GO

CREATE TABLE [AspProperty] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[url] [varchar] (100) NULL ,
	[space] [int] NULL CONSTRAINT [DF__AspProper__space__0C85DE4D] DEFAULT ((0)),
	[usedImagesSpace] [float] NULL CONSTRAINT [DF__AspProper__usedI__0D7A0286] DEFAULT ((0)),
	[usedBackupSpace] [float] NULL CONSTRAINT [DF__AspProper__usedB__0E6E26BF] DEFAULT ((0)),
	[usedSpace] [float] NULL CONSTRAINT [DF__AspProper__usedS__0F624AF8] DEFAULT ((0)),
	[buildByAsp] [varchar] (200) NULL CONSTRAINT [DF__AspProper__build__10566F31] DEFAULT ('0'),
	CONSTRAINT [AspProperty_PK] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[BackupInfo]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [BackupInfo]
GO

CREATE TABLE [BackupInfo] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[name] [varchar] (100) NULL ,
	[zipName] [varchar] (100) NULL ,
	[updateTime] [datetime] NULL ,
	[isSystem] [int] NOT NULL CONSTRAINT [DF__BackupInf__isSys__09A971A2] DEFAULT ((0)),
	[remark] [varchar] (200) NULL ,
	[type] [int] NULL ,
	CONSTRAINT [PK_BackupInfo] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[banner]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [banner]
GO

CREATE TABLE [banner] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[name] [varchar] (100) NULL ,
	[explain] [varchar] (100) NULL ,
	[material] [varchar] (100) NULL ,
	[background] [varchar] (100) NULL ,
	[url] [varchar] (100) NULL ,
	[notInRandom] [int] NULL ,
	[grouping] [int] NOT NULL CONSTRAINT [DF__banner__grouping__03F0984C] DEFAULT ((0)),
	[isSystem] [int] NOT NULL CONSTRAINT [DF__banner__isSystem__04E4BC85] DEFAULT ((0)),
	[adminId] [int] NULL ,
	CONSTRAINT [banner_PK] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO



if exists (select * from dbo.sysobjects where id = object_id(N'[BigResear]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [BigResear]
GO

CREATE TABLE [BigResear] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[Area] [nvarchar] (50) NULL ,
	[Address] [nvarchar] (50) NULL ,
	[ZipCode] [nvarchar] (6) NULL ,
	[Name] [nvarchar] (50) NULL ,
	[Department] [nvarchar] (50) NULL ,
	[Duty] [nvarchar] (50) NULL ,
	[Phone] [nvarchar] (15) NULL ,
	[DateY] [nvarchar] (5) NULL ,
	[DateM] [nvarchar] (5) NULL ,
	[DateD] [nvarchar] (5) NULL ,
	[Answer] [ntext] NULL ,
	CONSTRAINT [PK_BigResear] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[BigResearDate]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [BigResearDate]
GO

CREATE TABLE [BigResearDate] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[Date] [datetime] NULL ,
	CONSTRAINT [PK_BigResearDate] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[board]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [board]
GO

CREATE TABLE [board] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[name] [varchar] (500) NULL ,
	[boardContent] [ntext] NULL ,
	[bigClassId] [int] NULL ,
	[ordering] [int] NULL ,
	[IsTop] [int] NULL ,
	[showDay] [int] NULL ,
	[gate] [int] NULL ,
	[gradeId] [int] NULL ,
	[userId] [int] NULL ,
	[updateIp] [varchar] (100) NULL ,
	[updateTime] [datetime] NULL ,
	[passed] [int] NULL ,
	[isDuplicated] [int] NULL CONSTRAINT [DF__board__isDuplica__7F2BE32F] DEFAULT ((0)),
	[duplicateFrom] [varchar] (100) NULL ,
	[duplicatedPkId] [int] NULL ,
	CONSTRAINT [PK_board] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[Calendar]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [Calendar]
GO

CREATE TABLE [Calendar] (
	[pkId] [int] NOT NULL ,
	[bigClassId] [int] NOT NULL ,
	[DateByDay] [datetime] NULL ,
	[NewsNumber] [int] NULL 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[contribute]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [contribute]
GO

CREATE TABLE [contribute] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[intactTitle] [varchar] (100) NULL ,
	[Author] [varchar] (100) NULL ,
	[AuthorMail] [varchar] (100) NULL ,
	[CopyFrom] [varchar] (100) NULL ,
	[copyFromLink] [varchar] (100) NULL ,
	[about] [varchar] (100) NULL ,
	[pageType] [int] NULL ,
	[autoPageCharNum] [int] NULL ,
	[content] [text] NULL ,
	[userId] [int] NULL ,
	[updateTime] [datetime] NULL ,
	[state] [int] NULL ,
	[MenuId] [int] NULL ,
	[bigClassId] [int] NULL ,
	[updateIp] [varchar] (100) NULL ,
	[contributeId] [int] NULL ,
	[auditRemark] [text] NULL ,
	[newsId] [int] NULL ,
	CONSTRAINT [contribute_PK] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[contributeClass]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [contributeClass]
GO

CREATE TABLE [contributeClass] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[contributeClassId] [int] NULL ,
	[bigClassId] [int] NULL ,
	CONSTRAINT [PK_contributeClass] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[ContributePostil]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [ContributePostil]
GO

CREATE TABLE [ContributePostil] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[title] [varchar] (250) NULL ,
	[content] [text] NULL ,
	[isSystem] [int] NULL ,
	CONSTRAINT [PK_ContributePostil] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[department]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [department]
GO

CREATE TABLE [department] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[name] [varchar] (100) NULL ,
	CONSTRAINT [PK_department] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[discussProperty]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [discussProperty]
GO

CREATE TABLE [discussProperty] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[discussId] [int] NULL ,
	[mustLogin] [int] NULL ,
	[mustCheckPass] [int] NULL ,
	CONSTRAINT [PK_discussProperty] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[DownloadfileSpecialTemplate]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [DownloadfileSpecialTemplate]
GO

CREATE TABLE [DownloadfileSpecialTemplate] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[SpecialName] [varchar] (1000) NULL ,
	[GradeList] [varchar] (1000) NULL ,
	[SubjectList] [varchar] (1000) NULL ,
	[AutoTypeList] [varchar] (1000) NULL ,
	[bigClassId] [int] NULL 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[DynamicTable]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [DynamicTable]
GO

CREATE TABLE [DynamicTable] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[tableName] [varchar] (255) NULL ,
	[createTable] [varchar] (6000) NULL ,
	CONSTRAINT [PK_DynamicTable] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[FlashGameScoreData]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [FlashGameScoreData]
GO

CREATE TABLE [FlashGameScoreData] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[GameId] [int] NULL ,
	[userId] [nvarchar] (50) NULL ,
	[userName] [nvarchar] (50) NULL ,
	[score] [int] NULL 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[FlashGameScores]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [FlashGameScores]
GO

CREATE TABLE [FlashGameScores] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[userId] [nvarchar] (50) NULL ,
	[userName] [nvarchar] (50) NULL ,
	[gameId] [int] NULL ,
	[TotalScore] [int] NULL 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[grade]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [grade]
GO

CREATE TABLE [grade] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[name] [varchar] (100) NULL ,
	[remark] [varchar] (100) NULL ,
	CONSTRAINT [PK_grade] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[groupAssign]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [groupAssign]
GO

CREATE TABLE [groupAssign] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[groupId] [int] NULL ,
	[menuId] [int] NULL ,
	[privilegeSet] [varchar] (1000) NULL 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[GuangXiSFW]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [GuangXiSFW]
GO

CREATE TABLE [GuangXiSFW] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[Title] [nvarchar] (50) NULL ,
	[FileName] [nvarchar] (50) NULL ,
	[FileExtension] [varchar] (4) NULL ,
	[JoinTime] [datetime] NULL ,
	[UserID] [int] NULL ,
	[BigClassID] [int] NULL ,
	[Memo] [ntext] NULL ,
	[Users] [ntext] NULL ,
	[IsOver] [int] NULL 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[includePage]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [includePage]
GO

CREATE TABLE [includePage] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[pageUrl] [varchar] (100) NULL ,
	[updatetime] [datetime] NULL ,
	[updateIp] [varchar] (100) NULL ,
	[bigClassId] [int] NULL ,
	[menuId] [int] NULL ,
	[gradeId] [int] NULL ,
	[gate] [int] NULL ,
	[userId] [int] NULL ,
	[isTop] [int] NULL ,
	[ordering] [int] NULL ,
	[passed] [int] NULL ,
	[height] [int] NULL ,
	[iframeborder] [int] NULL ,
	[iframescroll] [int] NULL ,
	CONSTRAINT [PK_includePage] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[InfoSearch]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [InfoSearch]
GO

CREATE TABLE [InfoSearch] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[menuId] [int] NULL ,
	[bigClassId] [int] NULL ,
	[condition] [varchar] (1500) NULL ,
	[wherecondition] [varchar] (1500) NULL ,
	[fieldList] [varchar] (2000) NULL ,
	[result] [varchar] (2000) NULL ,
	[tableName] [varchar] (255) NULL ,
	[memo] [ntext] NULL ,
	[newsId] [int] NULL ,
	CONSTRAINT [PK_INFORMATIONSEARCH] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[IPInfo]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [IPInfo]
GO

CREATE TABLE [IPInfo] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[questionnaireSpecialId] [int] NULL ,
	[IP] [bigint] NULL ,
	[date] [datetime] NULL ,
	CONSTRAINT [PK_IPINFO] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[layoutTemplate]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [layoutTemplate]
GO

CREATE TABLE [layoutTemplate] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[name] [varchar] (100) NULL ,
	[template] [text] NULL ,
	[simple] [text] NULL ,
	[itemNum] [int] NULL ,
	[itemName] [varchar] (7000) NULL ,
	[isArtDesign] [int] NULL ,
	[layoutTemplateType] [int] NULL ,
	[isSystem] [int] NOT NULL CONSTRAINT [DF__layoutTem__isSys__5629CD9C] DEFAULT ((0)),
	[adminId] [int] NOT NULL CONSTRAINT [DF__layoutTem__admin__571DF1D5] DEFAULT ((1)),
	[bgpic] [varchar] (100) NULL ,
	CONSTRAINT [PK_layoutTemplate] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[librariesTemplate]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [librariesTemplate]
GO

CREATE TABLE [librariesTemplate] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[name] [varchar] (100) NULL ,
	[library] [text] NULL ,
	[adminId] [int] NULL ,
	[isSystem] [int] NOT NULL CONSTRAINT [DF__libraries__isSys__5165187F] DEFAULT ((0)),
	CONSTRAINT [librariesTemplate_PK] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[link]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [link]
GO

CREATE TABLE [link] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[name] [varchar] (100) NULL ,
	[pic] [varchar] (100) NULL ,
	[url] [varchar] (100) NULL ,
	[ordering] [int] NULL ,
	[isTop] [int] NULL ,
	[userId] [int] NULL ,
	[updateTime] [datetime] NULL ,
	[updateIp] [varchar] (100) NULL ,
	[passed] [int] NULL ,
	[gradeId] [int] NULL ,
	[gate] [int] NULL ,
	[bigClassId] [int] NULL ,
	[menuId] [int] NULL ,
	[IsPicLink] [int] NULL ,
	[height] [int] NOT NULL ,
	[width] [int] NOT NULL ,
	[Priority] [int] NULL CONSTRAINT [DF__link__Priority__4E88ABD4] DEFAULT ((0)),
	CONSTRAINT [PK_link] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[linkGroup]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [linkGroup]
GO

CREATE TABLE [linkGroup] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[groupName] [varchar] (100) NULL ,
	[remark] [varchar] (100) NULL ,
	[ordering] [int] NULL ,
	[userId] [int] NULL ,
	[updateTime] [datetime] NULL ,
	[updateIp] [varchar] (100) NULL ,
	[gradeId] [int] NULL ,
	[gate] [int] NULL ,
	[bigClassId] [int] NULL ,
	[menuId] [int] NULL ,
	[isShow] [int] NULL ,
	[Priority] [int] NULL CONSTRAINT [DF__linkGroup__Prior__70DDC3D8] DEFAULT ((0)),
	CONSTRAINT [PK_linkGroup] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[linkGang]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [linkGang]
GO

CREATE TABLE [linkGang] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[name] [varchar] (100) NULL ,
	[pic] [varchar] (100) NULL ,
	[url] [varchar] (100) NULL ,
	[ordering] [int] NULL ,
	[isTop] [int] NULL ,
	[userId] [int] NULL ,
	[updateTime] [datetime] NULL ,
	[updateIp] [varchar] (100) NULL ,
	[passed] [int] NULL ,
	[gradeId] [int] NULL ,
	[gate] [int] NULL ,
	[menuId] [int] NULL ,
	[IsPicLink] [int] NULL ,
	[height] [int] NULL ,
	[width] [int] NULL ,
	[groupId] [int] NULL ,
	[Priority] [int] NULL CONSTRAINT [DF__linkGang__Priori__30C33EC3] DEFAULT ((0)),
	CONSTRAINT [PK_linkGang] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] ,
	CONSTRAINT [FK_linkGang_linkGroup] FOREIGN KEY 
	(
		[groupId]
	) REFERENCES [linkGroup] (
		[pkId]
	)
) ON [PRIMARY]
GO



if exists (select * from dbo.sysobjects where id = object_id(N'[lockIp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [lockIp]
GO

CREATE TABLE [lockIp] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[ip1] [float] NULL ,
	[ip2] [float] NULL ,
	[sip1] [nvarchar] (50) NULL ,
	[sip2] [nvarchar] (50) NULL ,
	[remark] [varchar] (500) NULL ,
	[ipString1] [varchar] (100) NULL ,
	[ipString2] [varchar] (100) NULL ,
	CONSTRAINT [PK_lockIp] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[UsersGroup]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [UsersGroup]
GO

CREATE TABLE [UsersGroup] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[readInfoType] [int] NULL ,
	[Auditing] [int] NULL ,
	[topRight] [int] NULL ,
	[recommandRight] [int] NULL ,
	[allowLogin] [int] NULL ,
	[explain] [varchar] (100) NULL ,
	[groupName] [varchar] (100) NULL ,
	CONSTRAINT [UsersGroup_PK] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[Users]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [Users]
GO

CREATE TABLE [Users] (
	[pkId] [int] IDENTITY (1000, 1) NOT NULL ,
	[userName] [varchar] (100) NULL ,
	[fullName] [varchar] (100) NULL ,
	[password] [varchar] (100) NULL ,
	[question] [varchar] (100) NULL ,
	[answer] [varchar] (100) NULL ,
	[sex] [varchar] (10) NULL ,
	[born] [datetime] NULL ,
	[QQ] [varchar] (100) NULL ,
	[email] [varchar] (100) NULL ,
	[intro] [varchar] (100) NULL ,
	[loginIp] [varchar] (100) NULL ,
	[loginNum] [int] NULL ,
	[loginTime] [datetime] NULL ,
	[logIp] [varchar] (100) NULL ,
	[logTime] [datetime] NULL ,
	[tel] [varchar] (100) NULL ,
	[photo] [varchar] (100) NULL ,
	[examine] [int] NULL ,
	[gradeId] [int] NULL ,
	[departmentId] [int] NULL ,
	[company] [varchar] (100) NULL ,
	[appear] [int] NULL ,
	[networkTest] [int] NULL ,
	[Auditing] [int] NULL ,
	[manageAll] [int] NULL ,
	[usersGroupId] [int] NULL ,
	[readInfoType] [int] NULL ,
	[topRight] [int] NULL ,
	[recommandRight] [int] NULL ,
	[isSbwUser] [int] NULL CONSTRAINT [DF_Users_isSbwUser] DEFAULT ((1)),
	[isDel] [int] NULL CONSTRAINT [DF_Users_isDel] DEFAULT ((0)),
	[Address] [nchar] (30) NULL ,
	[PostCode] [char] (6) NULL ,
	[Fax] [char] (15) NULL ,
	CONSTRAINT [PK_user] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] ,
	CONSTRAINT [grade_Users_FK1] FOREIGN KEY 
	(
		[gradeId]
	) REFERENCES [grade] (
		[pkId]
	),
	CONSTRAINT [UsersGroup_Users_FK1] FOREIGN KEY 
	(
		[usersGroupId]
	) REFERENCES [UsersGroup] (
		[pkId]
	)
) ON [PRIMARY]
GO




if exists (select * from dbo.sysobjects where id = object_id(N'[UsersInRoles]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [UsersInRoles]
GO

CREATE TABLE [UsersInRoles] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[UserID] [int] NOT NULL ,
	[RoleID] [int] NOT NULL ,
	CONSTRAINT [PK_UsersInRoles] PRIMARY KEY  CLUSTERED 
	(
		[UserID],
		[RoleID]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO



if exists (select * from dbo.sysobjects where id = object_id(N'[menu]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [menu]
GO

CREATE TABLE [menu] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[parentId] [int] NULL ,
	[name] [varchar] (100) NULL ,
	[remark] [varchar] (100) NULL ,
	[ordering] [int] NULL ,
	[address] [varchar] (100) NULL ,
	[bigClassId] [int] NULL ,
	[modeId] [int] NULL ,
	[gradeId] [int] NULL ,
	[gate] [int] NULL ,
	[recorderNum] [int] NULL ,
	[menuPic] [varchar] (100) NULL ,
	[itemId] [varchar] (100) NULL ,
	[layoutTemplateId] [int] NULL ,
	[adminId] [int] NULL ,
	[displayRoot] [int] NOT NULL CONSTRAINT [DF__menu__displayRoo__6B24EA82] DEFAULT ((1)),
	[userIntercept] [int] NULL ,
	[interceptNums] [int] NULL ,
	[columnNum] [int] NULL ,
	[artDesignTemplateId] [int] NULL ,
	[contributeSortType] [int] NULL ,
	[navigate] [int] NULL CONSTRAINT [DF__menu__navigate__6C190EBB] DEFAULT ((0)),
	[newsTemplateId] [int] NULL ,
	[width] [int] NULL ,
	[height] [int] NULL ,
	[isStatic] [int] NULL ,
	[staticUrl] [varchar] (100) NULL ,
	[staticTime] [datetime] NULL ,
	[deslength] [int] NULL ,
	CONSTRAINT [PK_menu] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[menuset]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [menuset]
GO

CREATE TABLE [menuset] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[name] [varchar] (100) NULL ,
	[bgPic] [varchar] (100) NULL ,
	[backGroundPic] [varchar] (100) NULL ,
	[width] [int] NULL ,
	[effect] [varchar] (100) NULL ,
	[BackgroundColor] [varchar] (100) NULL ,
	[SelectedColor] [varchar] (100) NULL ,
	[OuterHighlightColor] [varchar] (100) NULL ,
	[InnerShadowColor] [varchar] (100) NULL ,
	[InnerHighlightColor] [varchar] (100) NULL ,
	[OuterShadowColor] [varchar] (100) NULL ,
	[SelectedTextColor] [varchar] (100) NULL ,
	[fontSize] [varchar] (100) NULL ,
	[fontColor] [varchar] (100) NULL ,
	[direction] [varchar] (100) NULL ,
	[menuDirection] [varchar] (100) NULL ,
	[itemBgPic] [varchar] (100) NULL ,
	[itemIconWidth] [int] NULL ,
	[itemIconHeight] [int] NULL ,
	[itemIconRightWidth] [int] NULL ,
	[PaddingLeft] [int] NULL ,
	[DividerHeight] [int] NULL ,
	[DividerColor] [varchar] (100) NULL ,
	[DividerImageAlignment] [varchar] (100) NULL ,
	[menuShow] [int] NULL ,
	[adminId] [int] NOT NULL CONSTRAINT [DF__menuset__adminId__6754599E] DEFAULT ((1)),
	[isSystem] [int] NOT NULL CONSTRAINT [DF__menuset__isSyste__68487DD7] DEFAULT ((0)),
	[rowNum] [int] NULL ,
	[fontWeight] [varchar] (100) NULL ,
	[subMenuFontSize] [varchar] (100) NULL ,
	[menulist] [text] NULL ,
	CONSTRAINT [PK_menuset] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[Message]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [Message]
GO

CREATE TABLE [Message] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[title] [varchar] (100) NULL ,
	[content] [text] NULL ,
	[usersId] [int] NULL ,
	[senderId] [int] NULL ,
	CONSTRAINT [Message_PK] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] ,
	CONSTRAINT [Users_Message_FK1] FOREIGN KEY 
	(
		[usersId]
	) REFERENCES [Users] (
		[pkId]
	)
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[messageBoard]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [messageBoard]
GO

CREATE TABLE [messageBoard] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[title] [varchar] (100) NULL ,
	[checked] [int] NULL ,
	[author] [varchar] (100) NULL ,
	[tel] [varchar] (100) NULL ,
	[isSecrecy] [int] NULL ,
	[email] [varchar] (100) NULL ,
	[sex] [varchar] (10) NULL ,
	[homePage] [varchar] (100) NULL ,
	[Content] [ntext] NULL ,
	[reContent] [ntext] NULL ,
	[userId] [int] NULL ,
	[updateTime] [datetime] NULL ,
	[updateIp] [varchar] (100) NULL ,
	[click] [int] NULL ,
	[isTop] [int] NULL ,
	[MenuId] [int] NULL ,
	[gradeId] [int] NULL ,
	[bigClassId] [int] NULL ,
	[gate] [int] NULL ,
	[username] [varchar] (100) NULL ,
	[password] [varchar] (50) NULL ,
	[retime] [datetime] NULL ,
	[redept] [varchar] (100) NULL ,
	[reAudit] [int] NULL ,
	CONSTRAINT [PK_messageBoard] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[messageBoardProperty]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [messageBoardProperty]
GO

CREATE TABLE [messageBoardProperty] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[allowAnonymityAppear] [int] NULL ,
	[isAllowAnonymityAppearSecrecy] [int] NULL ,
	[isAnonymityAuditing] [int] NULL ,
	[isRegisterAuditing] [int] NULL ,
	[isShowIp] [int] NULL ,
	[suspendUseMessageBoard] [int] NULL ,
	[isShowRespondFlag] [int] NULL ,
	[showParticularListWidth] [int] NULL ,
	CONSTRAINT [MessageBoardProperty_PK] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[messageForward]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [messageForward]
GO

CREATE TABLE [messageForward] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[messageId] [int] NOT NULL ,
	[ForwardToUserName] [nvarchar] (50) NOT NULL ,
	[Status] [int] NULL ,
	CONSTRAINT [PK_messageForward] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[mode]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [mode]
GO

CREATE TABLE [mode] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[name] [varchar] (100) NULL ,
	CONSTRAINT [mode_PK] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[moduleAssign]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [moduleAssign]
GO

CREATE TABLE [moduleAssign] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[usersId] [int] NULL ,
	[menuId] [int] NULL ,
	[privilegeSet] [varchar] (1000) NULL ,
	CONSTRAINT [PK_moduleAssign] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] ,
	CONSTRAINT [menu_moduleAssign_FK1] FOREIGN KEY 
	(
		[menuId]
	) REFERENCES [menu] (
		[pkId]
	),
	CONSTRAINT [Users_moduleAssign_FK1] FOREIGN KEY 
	(
		[usersId]
	) REFERENCES [Users] (
		[pkId]
	)
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[news]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [news]
GO

CREATE TABLE [news] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[specialId] [int] NULL ,
	[gradeId] [int] NULL ,
	[gate] [int] NULL ,
	[departmentId] [int] NULL ,
	[listTitle] [varchar] (1000) NULL ,
	[intactTitle] [varchar] (500) NULL ,
	[subheading] [varchar] (500) NULL ,
	[isRecommand] [int] NULL ,
	[isTop] [int] NULL ,
	[useListTitle] [int] NULL ,
	[showReviewLink] [int] NULL ,
	[Author] [varchar] (100) NULL ,
	[AuthorMail] [varchar] (100) NULL ,
	[CopyFrom] [varchar] (100) NULL ,
	[copyFromLink] [varchar] (100) NULL ,
	[about] [varchar] (100) NULL ,
	[pageType] [int] NULL ,
	[autoPageCharNum] [int] NULL ,
	[readPoint] [int] NULL ,
	[itemType] [int] NULL ,
	[content] [text] NULL ,
	[descript] [varchar] (1000) NULL ,
	[usersId] [int] NULL ,
	[editor] [varchar] (100) NULL ,
	[click] [int] NULL ,
	[updateTime] [datetime] NULL ,
	[passed] [int] NULL ,
	[isReview] [int] NULL ,
	[isImageNews] [int] NULL ,
	[imageName] [varchar] (100) NULL ,
	[MenuId] [int] NULL ,
	[bigClassId] [int] NULL ,
	[width] [int] NULL ,
	[height] [int] NULL ,
	[updateIp] [varchar] (100) NULL ,
	[useSubHeading] [int] NULL CONSTRAINT [DF__news__useSubHead__403A8C7D] DEFAULT ((0)),
	[isDuplicated] [int] NULL CONSTRAINT [DF__news__isDuplicat__412EB0B6] DEFAULT ((0)),
	[duplicateFrom] [varchar] (100) NULL ,
	[duplicatedPkId] [int] NULL ,
	[validDays] [int] NULL CONSTRAINT [DF__news__validDays__4222D4EF] DEFAULT ((-1)),
	[mediaAutostart] [int] NULL ,
	[AuditUserID] [int] NULL CONSTRAINT [DF__news__AuditUserI__4316F928] DEFAULT ((0)),
	[Priority] [int] NULL CONSTRAINT [DF__news__Priority__440B1D61] DEFAULT ((0)),
	CONSTRAINT [news_PK] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[NoteBook]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [NoteBook]
GO

CREATE TABLE [NoteBook] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[title] [varchar] (100) NULL ,
	[content] [text] NULL ,
	[usersId] [int] NULL ,
	CONSTRAINT [NoteBook_PK] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] ,
	CONSTRAINT [Users_NoteBook_FK1] FOREIGN KEY 
	(
		[usersId]
	) REFERENCES [Users] (
		[pkId]
	)
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[OperationLog]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [OperationLog]
GO

CREATE TABLE [OperationLog] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[operation] [varchar] (255) NULL ,
	[operationUserName] [varchar] (100) NULL ,
	[operationIp] [varchar] (100) NULL ,
	[operationTime] [datetime] NULL ,
	[remark] [text] NULL ,
	[type] [int] NULL ,
	[operationResult] [varchar] (100) NULL ,
	CONSTRAINT [PK_OperationLog] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[options]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [options]
GO

CREATE TABLE [options] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[questionId] [int] NULL ,
	[IsTextbox] [int] NULL ,
	[optionsName] [varchar] (1000) NULL ,
	[counter] [int] NULL ,
	[isPic] [int] NULL ,
	[txtName] [varchar] (1000) NULL ,
	[FirstResearCounter] [int] NULL CONSTRAINT [DF_options_FirstResearCounter] DEFAULT ((0)),
	[SecondResearCounter] [int] NULL CONSTRAINT [DF_options_SecondResearCounter] DEFAULT ((0)),
	CONSTRAINT [PK_OPTIONS] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[people]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [people]
GO

CREATE TABLE [people] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[introduceType] [int] NULL ,
	[name] [varchar] (100) NULL ,
	[sex] [varchar] (10) NOT NULL ,
	[department] [varchar] (100) NULL ,
	[pic] [varchar] (100) NULL ,
	[introduce] [ntext] NULL ,
	[honorType] [varchar] (100) NULL ,
	[honorGrade] [varchar] (100) NULL ,
	[ordering] [int] NULL ,
	[userId] [int] NULL ,
	[updateTime] [datetime] NULL ,
	[updateIp] [varchar] (100) NULL ,
	[isTop] [int] NULL ,
	[passed] [int] NULL ,
	[gradeId] [int] NULL ,
	[menuId] [int] NULL ,
	[bigClassId] [int] NULL ,
	[width] [int] NULL ,
	[height] [int] NULL ,
	[gate] [int] NULL ,
	CONSTRAINT [PK_people] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] ,
	CONSTRAINT [grade_people_FK1] FOREIGN KEY 
	(
		[gradeId]
	) REFERENCES [grade] (
		[pkId]
	)
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[popwindow]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [popwindow]
GO

CREATE TABLE [popwindow] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[title] [varchar] (100) NULL ,
	[content] [ntext] NULL ,
	[ordering] [int] NULL ,
	[popDay] [int] NULL ,
	[passed] [int] NULL ,
	[popLocation] [varchar] (100) NULL ,
	[width] [int] NULL ,
	[height] [int] NULL ,
	[gradeId] [int] NULL ,
	[gate] [int] NULL ,
	[userId] [int] NULL ,
	[updateTime] [datetime] NULL ,
	[updateIp] [varchar] (100) NULL ,
	[isTop] [int] NULL ,
	CONSTRAINT [PK_popwindow] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] ,
	CONSTRAINT [grade_popWindow_FK1] FOREIGN KEY 
	(
		[gradeId]
	) REFERENCES [grade] (
		[pkId]
	)
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[privilege]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [privilege]
GO

CREATE TABLE [privilege] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[name] [varchar] (100) NULL ,
	[nameRemark] [varchar] (100) NULL ,
	[accreditValue] [varchar] (100) NULL ,
	[accreditRemark] [varchar] (200) NULL ,
	[showType] [varchar] (100) NULL ,
	[itemEnglish] [varchar] (200) NULL ,
	[itemChinese] [varchar] (200) NULL ,
	CONSTRAINT [PK_privilege] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[question]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [question]
GO

CREATE TABLE [question] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[questionnaireSpecialId] [int] NULL ,
	[questionName] [varchar] (1000) NULL ,
	[NotNull] [int] NULL ,
	[optionsType] [int] NULL ,
	[optionsCount] [int] NULL ,
	CONSTRAINT [PK_QUESTION] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[questionnaireSpecial]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [questionnaireSpecial]
GO

CREATE TABLE [questionnaireSpecial] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[bigClassId] [int] NULL ,
	[questionnaireSpecialName] [varchar] (1000) NULL ,
	[validDays] [int] NULL ,
	[gate] [int] NULL ,
	[gradeId] [int] NULL ,
	[IsAnonymity] [int] NULL ,
	[restrictObject] [int] NULL ,
	[restrictMode] [int] NULL ,
	[restrictTime] [int] NULL ,
	[IsVerify] [int] NULL ,
	[generateDate] [datetime] NULL ,
	[IsShow] [int] NULL ,
	[IsShowNumber] [int] NULL ,
	[ItemType] [int] NULL ,
	CONSTRAINT [PK_QUESTIONNAIRESPECIAL] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[RegServiceList]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [RegServiceList]
GO

CREATE TABLE [RegServiceList] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[serviceId] [int] NULL ,
	[regServiceCode] [varchar] (250) NULL ,
	[isAllowService] [int] NULL ,
	[regTime] [datetime] NULL ,
	[auditTime] [datetime] NULL ,
	CONSTRAINT [PK_RegServiceList] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[RegUserInfo]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [RegUserInfo]
GO

CREATE TABLE [RegUserInfo] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[regProtocol] [text] NULL ,
	[forbidLoginExplain] [text] NULL ,
	[allowReg] [int] NULL ,
	[point] [int] NULL ,
	[days] [int] NULL ,
	[allowLogin] [int] NULL ,
	[examine] [int] NULL ,
	[readInfoType] [int] NULL ,
	CONSTRAINT [RegUserInfo_PK] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[resear]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [resear]
GO

CREATE TABLE [resear] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[title] [varchar] (100) NULL ,
	[name] [varchar] (100) NULL ,
	[counter] [int] NULL ,
	[bigClassId] [int] NULL ,
	[menuId] [int] NULL ,
	CONSTRAINT [PK_resear] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[ResourceClick]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [ResourceClick]
GO

CREATE TABLE [ResourceClick] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[ResourceId] [int] NULL ,
	[clicks] [int] NULL CONSTRAINT [DF__ResourceC__click__0AD2A005] DEFAULT ((0))
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[ResourceList]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [ResourceList]
GO

CREATE TABLE [ResourceList] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[DownLoadSpecialId] [int] NULL CONSTRAINT [DF_ResourceList_DownLoadSpecialId] DEFAULT ((266059)),
	[FileSize] [int] NULL ,
	[GradeId] [int] NULL ,
	[SubjectId] [int] NULL ,
	[AutoTypeId] [int] NULL ,
	[FileName] [varchar] (1000) NULL ,
	[FilePath] [varchar] (1000) NULL ,
	[Description] [varchar] (1000) NULL ,
	[FileType] [varchar] (100) NULL ,
	[Publisher] [varchar] (500) NULL ,
	[CreateTime] [datetime] NULL ,
	[UpdateTime] [datetime] NULL ,
	[Author] [varchar] (100) NULL ,
	[Grade] [varchar] (100) NULL ,
	[Subject] [varchar] (100) NULL ,
	[AutoType] [varchar] (100) NULL 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[resumeTable]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [resumeTable]
GO

CREATE TABLE [resumeTable] (
	[tableName] [varchar] (100) NOT NULL ,
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	CONSTRAINT [PK_resumeTable] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[review]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [review]
GO

CREATE TABLE [review] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[newsId] [int] NULL ,
	[name] [varchar] (100) NULL ,
	[content] [ntext] NULL ,
	[title] [varchar] (100) NULL ,
	[updateTime] [datetime] NULL ,
	[ipAddress] [varchar] (100) NULL ,
	[gradeId] [int] NULL ,
	[passed] [int] NULL ,
	[userPhoto] [nvarchar] (100) NULL ,
	CONSTRAINT [PK_review] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] ,
	CONSTRAINT [grade_review_FK1] FOREIGN KEY 
	(
		[gradeId]
	) REFERENCES [grade] (
		[pkId]
	),
	CONSTRAINT [news_review_FK1] FOREIGN KEY 
	(
		[newsId]
	) REFERENCES [news] (
		[pkId]
	)
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[Riches]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [Riches]
GO

CREATE TABLE [Riches] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[usersId] [int] NULL ,
	[addPoint] [int] NULL ,
	[subPoint] [int] NULL ,
	[updateTime] [datetime] NULL ,
	[remark] [varchar] (100) NULL ,
	[addDays] [int] NULL ,
	[subDays] [int] NULL ,
	CONSTRAINT [Riches_PK] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] ,
	CONSTRAINT [Users_Riches_FK1] FOREIGN KEY 
	(
		[usersId]
	) REFERENCES [Users] (
		[pkId]
	)
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[Roles]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [Roles]
GO

CREATE TABLE [Roles] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[RoleName] [nchar] (20) NOT NULL ,
	[Description] [nchar] (100) NOT NULL ,
	CONSTRAINT [PK_Roles] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[School]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [School]
GO

CREATE TABLE [School] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[SchoolName] [nvarchar] (100) NULL ,
	[Address] [nvarchar] (100) NULL ,
	[Contact] [nvarchar] (100) NULL ,
	[Telephone] [nvarchar] (100) NULL ,
	CONSTRAINT [PK_School] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[SchoolUsers]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [SchoolUsers]
GO

CREATE TABLE [SchoolUsers] (
	[pkId] [int] IDENTITY (1000, 1) NOT NULL ,
	[UserId] [int] NULL ,
	[SchoolId] [int] NULL ,
	[CanVoteFirst] [int] NULL ,
	[CanVoteSecond] [int] NULL ,
	[FirstSchoolInfo] [int] NULL ,
	[First] [int] NULL ,
	[Second] [int] NULL ,
	[Third] [int] NULL ,
	[Forth] [int] NULL ,
	[Fifth] [int] NULL ,
	[Sixth] [int] NULL ,
	[SecondResear] [int] NULL ,
	[Department] [int] NULL ,
	[IsAdmin] [int] NULL ,
	CONSTRAINT [PK_SchoolUsers] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[searchOptions]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [searchOptions]
GO

CREATE TABLE [searchOptions] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[bigClassId] [int] NULL ,
	[OptionsValue] [varchar] (3500) NULL ,
	[OptionsName] [varchar] (3500) NULL ,
	CONSTRAINT [PK_searchOptions] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[SensitiveWords]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [SensitiveWords]
GO

CREATE TABLE [SensitiveWords] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[ID] [char] (32) NULL ,
	[Level] [int] NULL ,
	[Word] [nvarchar] (50) NULL 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[ServiceClass]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [ServiceClass]
GO

CREATE TABLE [ServiceClass] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[bigClassId] [int] NULL ,
	[RegServiceListId] [int] NULL ,
	CONSTRAINT [PK_ServiceClass] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[SignUpBuildField]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [SignUpBuildField]
GO

CREATE TABLE [SignUpBuildField] (
	[PkId] [int] IDENTITY (1, 1) NOT NULL ,
	[TableName] [varchar] (100) NULL ,
	[Name] [varchar] (50) NULL ,
	[Type] [varchar] (50) NULL ,
	[Size] [int] NULL ,
	[ShowName] [varchar] (500) NULL ,
	[ShowType] [varchar] (250) NULL ,
	[ShowValue] [varchar] (1024) NULL ,
	[ShowComments] [varchar] (1024) NULL ,
	[AllowNull] [int] NULL ,
	[IsSystem] [int] NULL ,
	[IsOnly] [int] NULL ,
	[IsAddMark] [int] NULL ,
	[AddMarkField] [varchar] (50) NULL ,
	CONSTRAINT [PK_SignUpBuildField] PRIMARY KEY  CLUSTERED 
	(
		[PkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[SignUpField]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [SignUpField]
GO

CREATE TABLE [SignUpField] (
	[PkId] [int] IDENTITY (1, 1) NOT NULL ,
	[Name] [varchar] (50) NULL ,
	[Type] [varchar] (50) NULL ,
	[Size] [int] NULL ,
	[ShowName] [varchar] (500) NULL ,
	[ShowType] [varchar] (250) NULL ,
	[ShowValue] [varchar] (1024) NULL ,
	[ShowComments] [varchar] (1024) NULL ,
	[AllowNull] [int] NULL ,
	[IsSystem] [int] NULL ,
	[IsOnly] [int] NULL ,
	CONSTRAINT [PK_SignUpField] PRIMARY KEY  CLUSTERED 
	(
		[PkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[SignUpRelation]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [SignUpRelation]
GO

CREATE TABLE [SignUpRelation] (
	[PkId] [int] IDENTITY (1, 1) NOT NULL ,
	[BigClassId] [int] NULL ,
	[TableName] [varchar] (100) NULL ,
	CONSTRAINT [PK_SignUpRelation] PRIMARY KEY  CLUSTERED 
	(
		[PkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[siteBasicProperty]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [siteBasicProperty]
GO

CREATE TABLE [siteBasicProperty] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[grade] [int] NULL ,
	[defaultPassed] [int] NULL ,
	[review] [int] NULL ,
	[showIp] [int] NULL ,
	[reviewCheck] [int] NULL ,
	[reviewFiltrate] [varchar] (100) NULL ,
	[reviewAlternation] [int] NULL ,
	[showClick] [int] NULL ,
	[navGate] [int] NULL ,
	[navPage] [varchar] (100) NULL ,
	[pagesize] [int] NULL ,
	[shareNewsUrl] [varchar] (100) NULL ,
	[shareNewsLayoutTemplateID] [int] NULL ,
	[outputCacheTime] [int] NOT NULL CONSTRAINT [DF__siteBasic__outpu__164452B1] DEFAULT ((6)),
	[newsOpenMode] [int] NULL ,
	[IsAllowContribute] [int] NULL ,
	[IsAllowCopy] [int] NULL ,
	[SensitiveWordMonitorEnable] [bit] NULL ,
	[SensitiveWordMonitorPostPlatform] [bit] NULL ,
	[SensitiveWordMonitorPostPlatformServiceUrl] [varchar] (100) NULL ,
	CONSTRAINT [siteBasicProperty_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[siteContribute]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [siteContribute]
GO

CREATE TABLE [siteContribute] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[intactTitle] [varchar] (100) NULL ,
	[Author] [varchar] (100) NULL ,
	[AuthorMail] [varchar] (100) NULL ,
	[CopyFrom] [varchar] (100) NULL ,
	[copyFromLink] [varchar] (100) NULL ,
	[about] [varchar] (100) NULL ,
	[pageType] [int] NULL ,
	[autoPageCharNum] [int] NULL ,
	[content] [text] NULL ,
	[updateTime] [datetime] NULL ,
	[state] [int] NULL ,
	[bigClassId] [int] NULL ,
	[updateIp] [varchar] (100) NULL ,
	[auditRemark] [text] NULL ,
	[userName] [varchar] (100) NULL ,
	[newsId] [int] NULL ,
	[originalNewsId] [int] NULL ,
	CONSTRAINT [siteContribute_PK] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[siteContributeClass]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [siteContributeClass]
GO

CREATE TABLE [siteContributeClass] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[bigClassId] [int] NULL ,
	CONSTRAINT [siteContributeClass_PK] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[siteOtherProperty]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [siteOtherProperty]
GO

CREATE TABLE [siteOtherProperty] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[newsDefaultClick] [int] NULL ,
	[showNewHours] [int] NULL ,
	[showHotClick] [int] NULL ,
	[isAllowNewsUpdtime] [int] NULL ,
	CONSTRAINT [PK_siteOtherProperty] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[sitePara]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [sitePara]
GO

CREATE TABLE [sitePara] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[ptype] [varchar] (20) NOT NULL ,
	[pcode] [varchar] (20) NOT NULL ,
	[pvalue] [varchar] (100) NOT NULL ,
	[pseq] [int] NOT NULL ,
	[pnote] [varchar] (100) NULL ,
	CONSTRAINT [PK_sitePara] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] ,
	 UNIQUE  NONCLUSTERED 
	(
		[pcode]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[SMSRecord]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [SMSRecord]
GO

CREATE TABLE [SMSRecord] (
	[Sid] [int] IDENTITY (1, 1) NOT NULL ,
	[SPhone] [varchar] (50) NULL ,
	[SCode] [varchar] (50) NULL ,
	[STime] [datetime] NULL ,
	CONSTRAINT [PK_SMSRecord] PRIMARY KEY  CLUSTERED 
	(
		[Sid]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[SMSServer]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [SMSServer]
GO

CREATE TABLE [SMSServer] (
	[Sid] [int] IDENTITY (1, 1) NOT NULL ,
	[ServerName] [varchar] (50) NULL ,
	[ServerPwd] [varchar] (50) NULL ,
	[UpHost] [varchar] (50) NULL ,
	[UpPort] [int] NULL ,
	[DownHost] [varchar] (50) NULL ,
	[DownPort] [int] NULL ,
	CONSTRAINT [PK_SMSServer] PRIMARY KEY  CLUSTERED 
	(
		[Sid]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[special]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [special]
GO

CREATE TABLE [special] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[name] [varchar] (100) NULL ,
	CONSTRAINT [PK_special] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[stat]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [stat]
GO

CREATE TABLE [stat] (
	[time] [int] NOT NULL ,
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	CONSTRAINT [PK_stat] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[Tasks]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [Tasks]
GO

CREATE TABLE [Tasks] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[NO] [varchar] (20) NOT NULL ,
	[Title] [nvarchar] (100) NOT NULL ,
	[Department] [nvarchar] (100) NOT NULL ,
	[JoinTime] [datetime] NOT NULL ,
	[ADUserName1] [nvarchar] (20) NOT NULL ,
	[ADUserName1Time] [datetime] NOT NULL ,
	[UserID] [int] NOT NULL ,
	[PassTime] [datetime] NOT NULL ,
	[PassUserID] [int] NOT NULL ,
	[LeadingPassUserID] [int] NULL ,
	[LeadingPassTime] [datetime] NULL ,
	[OverTime] [datetime] NOT NULL ,
	[OverUserID] [int] NOT NULL ,
	[ResponsiblePersons] [nvarchar] (100) NOT NULL ,
	[RPSex] [int] NOT NULL ,
	[RPNational] [int] NOT NULL ,
	[RPBirthday] [datetime] NOT NULL ,
	[RPPositions] [int] NOT NULL ,
	[RPTitle] [int] NOT NULL ,
	[RPExpertise] [nvarchar] (20) NOT NULL ,
	[RPEducation] [int] NOT NULL ,
	[RPWorkDepartment] [nvarchar] (100) NOT NULL ,
	[RPAddress] [nvarchar] (100) NOT NULL ,
	[RPPostCode] [char] (6) NOT NULL ,
	[RPPhone] [varchar] (20) NOT NULL ,
	[RPEmail] [varchar] (100) NOT NULL ,
	[Participants] [ntext] NOT NULL ,
	[FinalResultsExpected] [int] NOT NULL ,
	[RelatedResearchResults] [ntext] NOT NULL ,
	[ResearchUndertakens] [ntext] NOT NULL ,
	[DesignVerificationIssues] [ntext] NOT NULL ,
	[CompletedTheFeasibilityAnalysis] [ntext] NOT NULL ,
	[MainResults] [ntext] NOT NULL ,
	[FinalResearchResults] [ntext] NOT NULL ,
	[TaskApplyDepartmentViews] [ntext] NOT NULL ,
	[ADUserName2] [nvarchar] (20) NOT NULL ,
	[ADUserName2Time] [datetime] NOT NULL ,
	[TotalGroupViews] [ntext] NOT NULL ,
	[TotalGroupViewsUserName] [nvarchar] (20) NOT NULL ,
	[TotalGroupViewsUserNameTime] [datetime] NOT NULL ,
	[LeadingGroupViews] [ntext] NOT NULL ,
	[LeadingGroupViewsUserName] [nvarchar] (20) NOT NULL ,
	[LeadingGroupViewsUserNameTime] [datetime] NOT NULL ,
	[Status] [int] NOT NULL ,
	[DocFile] [nvarchar] (1000) NOT NULL ,
	[BigClassID] [int] NOT NULL ,
	[Integrity] [int] NOT NULL ,
	CONSTRAINT [PK_TASKS] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO



if exists (select * from dbo.sysobjects where id = object_id(N'[templateType]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [templateType]
GO

CREATE TABLE [templateType] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[name] [varchar] (100) NULL ,
	[type] [varchar] (100) NULL ,
	[remark] [varchar] (1000) NULL ,
	CONSTRAINT [PK_templateType] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[template]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [template]
GO

CREATE TABLE [template] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[name] [varchar] (100) NULL ,
	[remark] [varchar] (100) NULL ,
	[code] [varchar] (100) NULL ,
	[previewTemplate] [varchar] (100) NULL ,
	[typeId] [int] NULL ,
	CONSTRAINT [template_PK] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] ,
	CONSTRAINT [FK_template_templateType] FOREIGN KEY 
	(
		[typeId]
	) REFERENCES [templateType] (
		[pkId]
	)
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[templatePrivilege]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [templatePrivilege]
GO

CREATE TABLE [templatePrivilege] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[templateId] [int] NULL ,
	[privilegeId] [int] NULL ,
	CONSTRAINT [PK_templatePrivilege] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] ,
	CONSTRAINT [FK_templatePrivilege_privilege] FOREIGN KEY 
	(
		[privilegeId]
	) REFERENCES [privilege] (
		[pkId]
	),
	CONSTRAINT [FK_templatePrivilege_template] FOREIGN KEY 
	(
		[templateId]
	) REFERENCES [template] (
		[pkId]
	)
) ON [PRIMARY]
GO



if exists (select * from dbo.sysobjects where id = object_id(N'[TimingQueue]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [TimingQueue]
GO

CREATE TABLE [TimingQueue] (
	[pkid] [int] NULL ,
	[newsid] [int] NULL ,
	[pass] [int] NULL ,
	[updatetime] [datetime] NULL 
) ON [PRIMARY]
GO



if exists (select * from dbo.sysobjects where id = object_id(N'[bigClass]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [bigClass]
GO

CREATE TABLE [bigClass] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[name] [varchar] (100) NULL ,
	[remark] [varchar] (100) NULL ,
	[templateId] [int] NULL ,
	[adminId] [int] NULL ,
	[updateTime] [datetime] NULL ,
	[isSystemItem] [int] NULL ,
	[cssName] [varchar] (100) NULL ,
	[morePageSize] [int] NULL CONSTRAINT [DF__bigClass__morePa__2A164134] DEFAULT ((0)),
	CONSTRAINT [PK_bigClass] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] ,
	CONSTRAINT [template_bigClass_FK1] FOREIGN KEY 
	(
		[templateId]
	) REFERENCES [template] (
		[pkId]
	)
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[BigClassAssociation]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [BigClassAssociation]
GO

CREATE TABLE [BigClassAssociation] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[menuId] [int] NULL ,
	[bigClassId] [int] NULL ,
	[thisBigClassId] [int] NULL ,
	CONSTRAINT [PK_BigClassAssociation] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[bigClassDesign]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [bigClassDesign]
GO

CREATE TABLE [bigClassDesign] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[menuId] [int] NOT NULL ,
	[cssname] [varchar] (100) NULL ,
	[isFlag] [int] NOT NULL CONSTRAINT [DF__bigClassD__isDot__6EE06CCD] DEFAULT ((0)),
	[imageFlag] [varchar] (100) NULL ,
	[isNew] [int] NOT NULL CONSTRAINT [DF__bigClassD__isNew__6FD49106] DEFAULT ((0)),
	[imageNew] [varchar] (100) NULL ,
	[isHot] [int] NOT NULL CONSTRAINT [DF__bigClassD__isHot__70C8B53F] DEFAULT ((0)),
	[imageHot] [varchar] (100) NULL ,
	[isTop] [int] NOT NULL CONSTRAINT [DF__bigClassD__isTop__71BCD978] DEFAULT ((0)),
	[imageTop] [varchar] (100) NULL ,
	[isMore] [int] NOT NULL CONSTRAINT [DF__bigClassD__isMor__72B0FDB1] DEFAULT ((1)),
	[imageMore] [varchar] (100) NULL ,
	[isDept] [int] NOT NULL CONSTRAINT [DF__bigClassD__isDep__73A521EA] DEFAULT ((0)),
	[isClick] [int] NOT NULL CONSTRAINT [DF__bigClassD__isCli__74994623] DEFAULT ((0)),
	[isTime] [int] NOT NULL CONSTRAINT [DF_bigClassDesign_isTime] DEFAULT ((0)),
	CONSTRAINT [PK_bigclassDesign] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[todayInHistory]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [todayInHistory]
GO

CREATE TABLE [todayInHistory] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[newsId] [int] NOT NULL ,
	[happenType] [int] NOT NULL ,
	[happenDate] [datetime] NOT NULL ,
	CONSTRAINT [PK_todayInHistory] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[unitInfo]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [unitInfo]
GO

CREATE TABLE [unitInfo] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[siteName] [varchar] (100) NULL ,
	[siteUrl] [varchar] (100) NULL ,
	[unitName] [varchar] (100) NULL ,
	[unitAddress] [varchar] (100) NULL ,
	[Phone] [varchar] (100) NULL ,
	[mailName] [varchar] (100) NULL ,
	[mail] [varchar] (100) NULL ,
	[copyright] [varchar] (100) NULL ,
	[version] [varchar] (100) NULL ,
	[versionId] [varchar] (100) NULL ,
	CONSTRAINT [unitInfo_PK] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[uploadFilesProperty]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [uploadFilesProperty]
GO

CREATE TABLE [uploadFilesProperty] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[picSize] [int] NULL ,
	[flashSize] [int] NULL ,
	[mediaSize] [int] NULL ,
	[otherSize] [int] NULL ,
	[remoteSize] [int] NULL ,
	[picType] [varchar] (1000) NULL ,
	[flashType] [varchar] (1000) NULL ,
	[mediaType] [varchar] (1000) NULL ,
	[otherType] [varchar] (1000) NULL ,
	[remoteType] [varchar] (1000) NULL ,
	[watermarkStat] [int] NULL ,
	[watermarkText] [varchar] (100) NULL ,
	[watermarkFontColor] [varchar] (100) NULL ,
	[watermarkShadowColor] [varchar] (100) NULL ,
	[watermarkShadowSize] [varchar] (100) NULL ,
	[watermarkFontSize] [varchar] (100) NULL ,
	[watermarkFont] [varchar] (100) NULL ,
	[watermarkPic] [varchar] (100) NULL ,
	[watermarkPlace] [varchar] (100) NULL ,
	[watermarkUseMode] [int] NULL ,
	[watermarkClarity] [int] NULL ,
	CONSTRAINT [uploadFilesProperty_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[UserApply]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [UserApply]
GO

CREATE TABLE [UserApply] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[unitName] [varchar] (150) NULL ,
	[ibe] [varchar] (150) NULL ,
	[username] [varchar] (20) NULL ,
	[password] [varchar] (18) NULL ,
	[province] [varchar] (150) NULL ,
	[city] [varchar] (150) NULL ,
	[county] [varchar] (150) NULL ,
	[unitType] [int] NULL ,
	[phone] [varchar] (50) NULL ,
	[email] [varchar] (80) NULL ,
	[allowSendSms] [bit] NULL ,
	[allowSmsRemind] [bit] NULL ,
	[memo] [ntext] NULL ,
	CONSTRAINT [PK_UserApply] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO

