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


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


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


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


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

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


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

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

CREATE TABLE [dbo].[Fanmv_ALinks] (
	[LinkID] [int] IDENTITY (1, 1) NOT NULL PRIMARY KEY ,
	[LinkName] [nvarchar] (80) COLLATE Chinese_PRC_CI_AS NULL ,
	[LinkDes] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[LinkUrl] [varchar] (120) COLLATE Chinese_PRC_CI_AS NULL 
)


CREATE TABLE [Fanmv_Admin] (
	[AdminID] [int] IDENTITY (1, 1) NOT NULL PRIMARY KEY ,
	[IsSystem] [tinyint] NULL DEFAULT (0) ,
	[AdminName] [varchar] (120) COLLATE Chinese_PRC_CI_AS NULL ,
	[AdminPass] [varchar] (48) COLLATE Chinese_PRC_CI_AS NULL ,
	[LoginIP] [varchar] (40) COLLATE Chinese_PRC_CI_AS NULL ,
	[LoginTime] [datetime] NULL 
)



CREATE TABLE [Fanmv_Column] (
	[ColumnID] [int] IDENTITY (1, 1) NOT NULL PRIMARY KEY ,
	[ParentID] [int] NULL DEFAULT (0) ,
	[Depth] [int] NULL DEFAULT (0) ,
	[OrderID] [int] NULL DEFAULT (1) ,
	[ColumnType] [int] NULL ,
	[ColumnName] [nvarchar] (80) COLLATE Chinese_PRC_CI_AS NULL ,
	[ColumnDir] [varchar] (80) COLLATE Chinese_PRC_CI_AS NULL ,
	[ColumnTemplate] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[InfoTemplate] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Keywords] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Description] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[VisitUrl] [varchar] (120) COLLATE Chinese_PRC_CI_AS NULL 
) 


CREATE TABLE [Fanmv_Database] (
	[DbID] [int] IDENTITY (1, 1) NOT NULL PRIMARY KEY ,
	[DbName] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[DbPath] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[AddTime] [datetime] NULL 
)



CREATE TABLE [Fanmv_Fail] (
	[FailID] [int] IDENTITY (1, 1) NOT NULL PRIMARY KEY ,
	[AdminName] [varchar] (120) COLLATE Chinese_PRC_CI_AS NULL ,
	[LoginIP] [varchar] (40) COLLATE Chinese_PRC_CI_AS NULL ,
	[LoginTime] [datetime] NULL ,
	[FailNum] [int] NULL DEFAULT (0) 
)


CREATE TABLE [Fanmv_Info] (
	[InfoID] [int] IDENTITY (1, 1) NOT NULL PRIMARY KEY ,
	[ColumnID] [int] NULL DEFAULT (0) ,
	[IsAudit] [tinyint] NULL DEFAULT (0) ,
	[Title] [nvarchar] (80) COLLATE Chinese_PRC_CI_AS NULL ,
	[FontColor] [varchar] (7) COLLATE Chinese_PRC_CI_AS NULL ,
	[InfoPic] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Intro] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[Content] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[Author] [nvarchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[CopyFrom] [nvarchar] (120) COLLATE Chinese_PRC_CI_AS NULL ,
	[IsPic] [tinyint] NULL DEFAULT (0) ,
	[IsElite] [tinyint] NULL DEFAULT (0) ,
	[ViewCount] [int] NULL DEFAULT (0) ,
	[PubTime] [datetime] NULL ,
	[AddTime] [datetime] NULL ,
	[Keywords] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Description] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[VisitFile] [varchar] (120) COLLATE Chinese_PRC_CI_AS NULL ,
	[VisitUrl] [varchar] (120) COLLATE Chinese_PRC_CI_AS NULL 
)


CREATE TABLE [Fanmv_Online] (
	[OnlineID] [int] IDENTITY (1, 1) NOT NULL PRIMARY KEY ,
	[AdminName] [varchar] (120) COLLATE Chinese_PRC_CI_AS NULL ,
	[OSessionID] [varchar] (64) COLLATE Chinese_PRC_CI_AS NULL ,
	[LoginIP] [varchar] (40) COLLATE Chinese_PRC_CI_AS NULL ,
	[LoginTime] [datetime] NULL ,
	[UpdateTime] [datetime] NULL 
)



CREATE TABLE [dbo].[Fanmv_Label] (
	[LabelID] [int] IDENTITY (1, 1) NOT NULL PRIMARY KEY ,
	[IsSystem] [tinyint] NULL DEFAULT (0)  ,
	[OrderID] [int] NULL ,
	[LabelTitle] [nvarchar] (80) COLLATE Chinese_PRC_CI_AS NULL ,
	[LabelName] [varchar] (80) COLLATE Chinese_PRC_CI_AS NULL ,
	[LabelContent] [ntext] COLLATE Chinese_PRC_CI_AS NULL 
)