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

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

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

CREATE TABLE [dbo].[CollectionFilter] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[FilterName] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[OwnerItem] [int] NULL ,
	[FilterObject] [int] NULL ,
	[RunType] [int] NULL ,
	[FilterType] [int] NULL ,
	[FisString] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[FioString] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[PlaceStr] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[TagRegEx] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[TagRegExPlaceStr] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[Flag] [int] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[CollectionItem] (
	[ItemID] [int] IDENTITY (1, 1) NOT NULL ,
	[A] [int] NULL ,
	[B] [int] NULL ,
	[Slt] [int] NULL ,
	[Sy] [int] NULL ,
	[Zswj] [int] NULL ,
	[ItemName] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[Charset] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[BaseUrl] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[PicFolder] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[List] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[List_Auto] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[List_Auto_Begin] [int] NULL ,
	[List_Auto_End] [int] NULL ,
	[List_B] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[List_E] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[List_href_B] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[List_href_E] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[List_href_Yes] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[List_href_No] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[Title_B] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[Title_E] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[Title_P_B] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[Title_P_E] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[Mark_P_B] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[Mark_P_E] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[Pic_B] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[Pic_E] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[Pic_Href_B] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[Pic_Href_E] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[Pagination_B] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[Pagination_E] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[Pagination_href_B] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[Pagination_href_E] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[Filter] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[Rule] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[Flag] [int] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[History] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[NewsUrl] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[Title] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[Text] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[Pages] [int] NULL ,
	[Photos] [int] NULL ,
	[Photo] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[PhotoFaile] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[CollecDate] [datetime] NULL ,
	[OwnerItem] [int] NULL ,
	[Result] [int] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

ALTER TABLE [dbo].[CollectionFilter] ADD 
	CONSTRAINT [DF_CollectionFilter_Flag] DEFAULT (1) FOR [Flag],
	CONSTRAINT [PK_CollectionFilter] PRIMARY KEY  CLUSTERED 
	(
		[Id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[CollectionItem] ADD 
	CONSTRAINT [DF_CollectionItem_Flag] DEFAULT (0) FOR [Flag],
	CONSTRAINT [PK_CollectionItem] PRIMARY KEY  CLUSTERED 
	(
		[ItemID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[History] ADD 
	CONSTRAINT [PK_History] PRIMARY KEY  CLUSTERED 
	(
		[Id]
	)  ON [PRIMARY] 
GO
INSERT INTO dbo.CollectionItem
  (A,B,Slt,Sy,Zswj,ItemName,Charset,BaseUrl,PicFolder,List,List_Auto,List_Auto_Begin,List_Auto_End,List_B,List_E,List_href_B,List_href_E,List_href_Yes,List_href_No,Title_B,Title_E,Title_P_B,Title_P_E,Mark_P_B,Mark_P_E,Pic_B,Pic_E,Pic_Href_B,Pic_Href_E,Pagination_B,Pagination_E,Pagination_href_B,Pagination_href_E,Filter,[Rule],Flag)
VALUES(null,null,null,null,null,'天极图片> 型男色女','GB2312','http://pic.dc.yesky.com','\lib\非主流美女\2008\6\18\','http://pic.dc.yesky.com/pic/meinv/index.shtml
http://pic.dc.yesky.com/pic/meinv/his.shtml','http://pic.dc.yesky.com/pic/meinv/his/his_{$ID}.shtml',1706,1,'<!--中间图片列表-->','<!--右侧推荐排行榜等-->','<a href="','">','','','</font></a>&nbsp;&nbsp;&nbsp;&nbsp;<br/>','<br></div><div class="clear"></div>','<title>','</title>','<title>','</title>','【点击查看大图】','<br></div><div class="clear"></div>','<img src="','" alt="','【点击查看大图】','间隔时间','<a class="page" href="','" target="_self">',null,null,1);

INSERT INTO dbo.CollectionItem
  (A,B,Slt,Sy,Zswj,ItemName,Charset,BaseUrl,PicFolder,List,List_Auto,List_Auto_Begin,List_Auto_End,List_B,List_E,List_href_B,List_href_E,List_href_Yes,List_href_No,Title_B,Title_E,Title_P_B,Title_P_E,Mark_P_B,Mark_P_E,Pic_B,Pic_E,Pic_Href_B,Pic_Href_E,Pagination_B,Pagination_E,Pagination_href_B,Pagination_href_E,Filter,[Rule],Flag)
VALUES(null,null,null,null,null,'广西大学生网>>日韩女明星','GB2312','http://star.gxu.com.cn','\lib\0621\','http://star.gxu.com.cn/List/List_1993_1.html','',null,null,'日韩女明星明星信息列表','<!-- 分页开始 -->','href="','" title=','','','charset=gb2312">
<meta content="','" name="description">','charset=gb2312">
<meta content="','" name="description">','charset=gb2312">
<meta content="','" name="description">','<!--插入广告JS代码-->','点击数','src="','"','<!--插入广告JS代码-->','点击数','a href=''','''',null,null,1);

