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__0504B816] DEFAULT (0)
) 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) COLLATE Chinese_PRC_CI_AS NULL ,
	[OptionsName] [varchar] (3500) COLLATE Chinese_PRC_CI_AS NULL ,
	CONSTRAINT [PK_searchOptions] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) 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) COLLATE Chinese_PRC_CI_AS NULL ,
	[FilePath] [varchar] (1000) COLLATE Chinese_PRC_CI_AS NULL ,
	[Description] [varchar] (1000) COLLATE Chinese_PRC_CI_AS NULL ,
	[FileType] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Publisher] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[CreateTime] [datetime] NULL ,
	[UpdateTime] [datetime] NULL ,
	[Author] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Grade] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Subject] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[AutoType] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL 
) 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) COLLATE Chinese_PRC_CI_AS NULL ,
	[GradeList] [varchar] (1000) COLLATE Chinese_PRC_CI_AS NULL ,
	[SubjectList] [varchar] (1000) COLLATE Chinese_PRC_CI_AS NULL ,
	[AutoTypeList] [varchar] (1000) COLLATE Chinese_PRC_CI_AS NULL ,
	[bigClassId] [int] NULL 
) ON [PRIMARY]
GO


