/******  2011-11-22 更新 4.1-4.2 ******/
/****** 对象: 表 [dbo].[e_pdf]  ******/
if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[e_pdf]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
CREATE TABLE [dbo].[e_pdf] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[qiid] [int] NULL ,
	[editionid] [int] NULL ,
	[pname] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[pcontent] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[pdfpath] [varchar] (120) COLLATE Chinese_PRC_CI_AS NULL ,
	[textpath] [varchar] (120) COLLATE Chinese_PRC_CI_AS NULL ,
	[isextract] [bit] NULL ,
	[addtime] [datetime] NULL ,
	[edittime] [datetime] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** 对象: 表 [dbo].[e_pdfpic]  ******/
if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[e_pdfpic]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
CREATE TABLE [dbo].[e_pdfpic] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[pdfid] [int] NULL ,
	[picurl] [varchar] (120) COLLATE Chinese_PRC_CI_AS NULL ,
	[firsturl] [varchar] (120) COLLATE Chinese_PRC_CI_AS NULL ,
	[isuse] [bit] NULL 
) ON [PRIMARY]
GO
/****** 对象: 表 [dbo].[e_pdfcon]  ******/
if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[e_pdfcon]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
CREATE TABLE [dbo].[e_pdfcon] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[pdfid] [int] NULL ,
	[qiid] [int] NULL ,
	[editionid] [int] NULL ,
	[dtitle] [nvarchar] (120) COLLATE Chinese_PRC_CI_AS NULL ,
	[dcontent] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[isuse] [bit] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/******  2011-11-22 更新完 4.1-4.2 ******/


/*2011-11-22 Update 4.1-4.2 */
if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[PK_e_pdf]') and OBJECTPROPERTY(id, N'IsPrimaryKey') = 1)
BEGIN
ALTER TABLE [dbo].[e_pdf] WITH NOCHECK ADD 
	CONSTRAINT [PK_e_pdf] PRIMARY KEY  CLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
END
GO

if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[PK_e_pdfpic]') and OBJECTPROPERTY(id, N'IsPrimaryKey') = 1)
BEGIN
ALTER TABLE [dbo].[e_pdfpic] WITH NOCHECK ADD 
	CONSTRAINT [PK_e_pdfpic] PRIMARY KEY  CLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
END
GO

if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[PK_e_pdfcon]') and OBJECTPROPERTY(id, N'IsPrimaryKey') = 1)
BEGIN
ALTER TABLE [dbo].[e_pdfcon] WITH NOCHECK ADD 
	CONSTRAINT [PK_e_pdfcon] PRIMARY KEY  CLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
END
GO

if not exists (select 1 from dbo.sysobjects where id = object_id(N'[dbo].[FK_e_pdfpic_e_pdf]')  AND name = 'FK_e_pdfpic_e_pdf')
ALTER TABLE [dbo].[e_pdfpic] ADD 
	CONSTRAINT [FK_e_pdfpic_e_pdf] FOREIGN KEY 
	(
		[pdfid]
	) REFERENCES [dbo].[e_pdf] (
		[id]
	)
GO
if not exists (select 1 from dbo.sysobjects where id = object_id(N'[dbo].[FK_e_pdfcon_e_pdf]')  AND name = 'FK_e_pdfcon_e_pdf')
ALTER TABLE [dbo].[e_pdfcon] ADD 
	CONSTRAINT [FK_e_pdfcon_e_pdf] FOREIGN KEY 
	(
		[pdfid]
	) REFERENCES [dbo].[e_pdf] (
		[id]
	)
GO
/****** 对象: 表 [dbo].[mvc_adminmenu]   2011-12-16 ******/
INSERT [dbo].[mvc_adminmenu] ([id], [classname], [classen], [classdes], [parentid], [depth], [parentpath], [childclass], [sortid], [isrefer], [referurl]) VALUES (86, N'PDF自动导入', convert(text, N'' collate Chinese_PRC_CI_AS), N'', 0, 0, convert(text, N'0' collate Chinese_PRC_CI_AS), convert(text, N'86,87,88' collate Chinese_PRC_CI_AS), 5, 1, convert(text, N'Default.aspx' collate Chinese_PRC_CI_AS))
INSERT [dbo].[mvc_adminmenu] ([id], [classname], [classen], [classdes], [parentid], [depth], [parentpath], [childclass], [sortid], [isrefer], [referurl]) VALUES (87, N'PDF任务添加', convert(text, N'' collate Chinese_PRC_CI_AS), N'', 86, 1, convert(text, N'0,86' collate Chinese_PRC_CI_AS), convert(text, N'87' collate Chinese_PRC_CI_AS), 1, 1, convert(text, N'Pdfadd.aspx' collate Chinese_PRC_CI_AS))
INSERT [dbo].[mvc_adminmenu] ([id], [classname], [classen], [classdes], [parentid], [depth], [parentpath], [childclass], [sortid], [isrefer], [referurl]) VALUES (88, N'PDF任务管理', convert(text, N'' collate Chinese_PRC_CI_AS), N'', 86, 1, convert(text, N'0,86' collate Chinese_PRC_CI_AS), convert(text, N'88' collate Chinese_PRC_CI_AS), 2, 1, convert(text, N'Pdfmanage.aspx' collate Chinese_PRC_CI_AS))
/*2011-11-22 Update Finish 4.1-4.2 */
