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

CREATE TABLE [InfoSearch] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[menuId] [int] NULL ,
	[bigClassId] [int] NULL ,
	[condition] [varchar] (1500) COLLATE Chinese_PRC_CI_AS NULL ,
	[wherecondition] [varchar] (1500) COLLATE Chinese_PRC_CI_AS NULL ,
	[fieldList] [varchar] (2000) COLLATE Chinese_PRC_CI_AS NULL ,
	[result] [varchar] (2000) COLLATE Chinese_PRC_CI_AS NULL ,
	[tableName] [varchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[memo] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	CONSTRAINT [PK_INFORMATIONSEARCH] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO


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

CREATE TABLE [RegServiceList] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[serviceId] [int] NULL ,
	[regServiceCode] [varchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
	[isAllowService] [int] NULL ,
	[regTime] [datetime] NULL ,
	[auditTime] [datetime] NULL ,
	CONSTRAINT [PK_RegServiceList] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


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

CREATE TABLE [ServiceClass] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[bigClassId] [int] NULL ,
	[RegServiceListId] [int] NULL ,
	CONSTRAINT [PK_ServiceClass] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


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

CREATE TABLE [DynamicTable] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[tableName] [varchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[createTable] [varchar] (6000) COLLATE Chinese_PRC_CI_AS NULL ,
	CONSTRAINT [PK_DynamicTable] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO


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

CREATE TABLE [ContributePostil] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[title] [varchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
	[content] [text] COLLATE Chinese_PRC_CI_AS NULL ,
	[isSystem] [int] NULL ,
	CONSTRAINT [PK_ContributePostil] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO


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

CREATE TABLE [UserApply] (
	[pkId] [int] IDENTITY (1, 1) NOT NULL ,
	[unitName] [varchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[ibe] [varchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[username] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[password] [varchar] (18) COLLATE Chinese_PRC_CI_AS NULL ,
	[province] [varchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[city] [varchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[county] [varchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[unitType] [int] NULL ,
	[phone] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[email] [varchar] (80) COLLATE Chinese_PRC_CI_AS NULL ,
	[allowSendSms] [bit] NULL ,
	[allowSmsRemind] [bit] NULL ,
	[memo] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	CONSTRAINT [PK_UserApply] PRIMARY KEY  CLUSTERED 
	(
		[pkId]
	)  ON [PRIMARY] 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO


