/******  2012-3-1 ¸üÐÂ 4.7-4.8 ¿ªÊ¼******/
if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[e_smtp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
CREATE TABLE [dbo].[e_smtp] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[adminid] [int] NULL ,
	[sendtype] [int] NULL ,
	[smtpchen] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[smtpemail] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[smtpserver] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[smtppass] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

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

if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[e_body]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
CREATE TABLE [dbo].[e_body] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[adminid] [int] NULL ,
	[fromemail] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[fromchen] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[toemail] [varchar] (2000) COLLATE Chinese_PRC_CI_AS NULL ,
	[tochen] [char] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[title] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[bodystr] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[addfile] [varchar] (120) COLLATE Chinese_PRC_CI_AS NULL ,
	[bodycode] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[htmltype] [int] NULL ,
	[issend] [bit] NULL ,
	[istxt] [bit] NULL ,
	[emailnum] [int] NULL ,
	[addtime] [datetime] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[PK_e_body]') and OBJECTPROPERTY(id, N'IsPrimaryKey') = 1)
ALTER TABLE [dbo].[e_body] WITH NOCHECK ADD 
	CONSTRAINT [PK_e_body] PRIMARY KEY  CLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO
/******e_eachqi*****/
alter table [dbo].[e_eachqi] ADD [qilink] [varchar] (120) COLLATE Chinese_PRC_CI_AS NULL 
GO
UPDATE [dbo].[e_eachqi] SET [qilink] =''
GO

/******mvc_info*****/
alter table [dbo].[mvc_info] ADD [subtitle] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
[reporter] [nvarchar] (80) COLLATE Chinese_PRC_CI_AS NULL
GO
UPDATE [dbo].[mvc_info] SET [subtitle] ='',[reporter]=''
GO