
/****** Object:  Table [dbo].[Account_BankCard]    Script Date: 01/20/2016 18:36:15 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Account_BankCard]') AND type in (N'U'))
DROP TABLE [dbo].[Account_BankCard]
GO
/****** Object:  Table [dbo].[Account_CashApply]    Script Date: 01/20/2016 18:36:15 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Account_CashApply]') AND type in (N'U'))
DROP TABLE [dbo].[Account_CashApply]
GO
/****** Object:  Table [dbo].[Account_ReceiveRepayLog]    Script Date: 01/20/2016 18:36:15 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Account_ReceiveRepayLog]') AND type in (N'U'))
DROP TABLE [dbo].[Account_ReceiveRepayLog]
GO
/****** Object:  Table [dbo].[Account_Recharge]    Script Date: 01/20/2016 18:36:15 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Account_Recharge]') AND type in (N'U'))
DROP TABLE [dbo].[Account_Recharge]
GO
/****** Object:  Table [dbo].[Account_TempHold]    Script Date: 01/20/2016 18:36:15 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Account_TempHold]') AND type in (N'U'))
DROP TABLE [dbo].[Account_TempHold]
GO
/****** Object:  Table [dbo].[Account_UserAccount]    Script Date: 01/20/2016 18:36:15 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Account_UserAccount]') AND type in (N'U'))
DROP TABLE [dbo].[Account_UserAccount]
GO
/****** Object:  Table [dbo].[Account_UserAccountLog]    Script Date: 01/20/2016 18:36:14 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Account_UserAccountLog]') AND type in (N'U'))
DROP TABLE [dbo].[Account_UserAccountLog]
GO
/****** Object:  Table [dbo].[Article_Article]    Script Date: 01/20/2016 18:36:14 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Article_Article]') AND type in (N'U'))
DROP TABLE [dbo].[Article_Article]
GO
/****** Object:  Table [dbo].[Article_Category]    Script Date: 01/20/2016 18:36:14 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Article_Category]') AND type in (N'U'))
DROP TABLE [dbo].[Article_Category]
GO
/****** Object:  Table [dbo].[Article_HelpArticle]    Script Date: 01/20/2016 18:36:14 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Article_HelpArticle]') AND type in (N'U'))
DROP TABLE [dbo].[Article_HelpArticle]
GO
/****** Object:  Table [dbo].[Article_HelpCategory]    Script Date: 01/20/2016 18:36:13 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Article_HelpCategory]') AND type in (N'U'))
DROP TABLE [dbo].[Article_HelpCategory]
GO
/****** Object:  Table [dbo].[BBS_Category]    Script Date: 01/20/2016 18:36:13 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BBS_Category]') AND type in (N'U'))
DROP TABLE [dbo].[BBS_Category]
GO
/****** Object:  Table [dbo].[BBS_Reply]    Script Date: 01/20/2016 18:36:13 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BBS_Reply]') AND type in (N'U'))
DROP TABLE [dbo].[BBS_Reply]
GO
/****** Object:  Table [dbo].[BBS_Topic]    Script Date: 01/20/2016 18:36:13 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BBS_Topic]') AND type in (N'U'))
DROP TABLE [dbo].[BBS_Topic]
GO
/****** Object:  Table [dbo].[BorrowLoan_AutoBid]    Script Date: 01/20/2016 18:36:13 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_AutoBid]') AND type in (N'U'))
DROP TABLE [dbo].[BorrowLoan_AutoBid]
GO
/****** Object:  Table [dbo].[BorrowLoan_AutoRepay]    Script Date: 01/20/2016 18:36:13 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_AutoRepay]') AND type in (N'U'))
DROP TABLE [dbo].[BorrowLoan_AutoRepay]
GO
/****** Object:  Table [dbo].[BorrowLoan_Bid]    Script Date: 01/20/2016 18:36:13 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_Bid]') AND type in (N'U'))
DROP TABLE [dbo].[BorrowLoan_Bid]
GO
/****** Object:  Table [dbo].[BorrowLoan_Borrow]    Script Date: 01/20/2016 18:36:13 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_Borrow]') AND type in (N'U'))
DROP TABLE [dbo].[BorrowLoan_Borrow]
GO
/****** Object:  Table [dbo].[BorrowLoan_OfflineApply]    Script Date: 01/20/2016 18:36:12 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_OfflineApply]') AND type in (N'U'))
DROP TABLE [dbo].[BorrowLoan_OfflineApply]
GO
/****** Object:  Table [dbo].[BorrowLoan_OverdueList]    Script Date: 01/20/2016 18:36:12 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_OverdueList]') AND type in (N'U'))
DROP TABLE [dbo].[BorrowLoan_OverdueList]
GO
/****** Object:  Table [dbo].[BorrowLoan_Promotion]    Script Date: 01/20/2016 18:36:12 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_Promotion]') AND type in (N'U'))
DROP TABLE [dbo].[BorrowLoan_Promotion]
GO
/****** Object:  Table [dbo].[BorrowLoan_PromotionLog]    Script Date: 01/20/2016 18:36:12 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_PromotionLog]') AND type in (N'U'))
DROP TABLE [dbo].[BorrowLoan_PromotionLog]
GO
/****** Object:  Table [dbo].[BorrowLoan_Receive]    Script Date: 01/20/2016 18:36:12 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_Receive]') AND type in (N'U'))
DROP TABLE [dbo].[BorrowLoan_Receive]
GO
/****** Object:  Table [dbo].[BorrowLoan_Repay]    Script Date: 01/20/2016 18:36:12 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_Repay]') AND type in (N'U'))
DROP TABLE [dbo].[BorrowLoan_Repay]
GO
/****** Object:  Table [dbo].[BorrowLoan_Reservation]    Script Date: 01/20/2016 18:36:12 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_Reservation]') AND type in (N'U'))
DROP TABLE [dbo].[BorrowLoan_Reservation]
GO
/****** Object:  Table [dbo].[BorrowLoan_ReservationInfo]    Script Date: 01/20/2016 18:36:12 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_ReservationInfo]') AND type in (N'U'))
DROP TABLE [dbo].[BorrowLoan_ReservationInfo]
GO
/****** Object:  Table [dbo].[BorrowLoan_ReservationLog]    Script Date: 01/20/2016 18:36:11 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_ReservationLog]') AND type in (N'U'))
DROP TABLE [dbo].[BorrowLoan_ReservationLog]
GO
/****** Object:  Table [dbo].[BorrowLoan_Transfer]    Script Date: 01/20/2016 18:36:11 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_Transfer]') AND type in (N'U'))
DROP TABLE [dbo].[BorrowLoan_Transfer]
GO
/****** Object:  Table [dbo].[BorrowLoan_TransferLog]    Script Date: 01/20/2016 18:36:11 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_TransferLog]') AND type in (N'U'))
DROP TABLE [dbo].[BorrowLoan_TransferLog]
GO
/****** Object:  Table [dbo].[BorrowLoan_Vouch]    Script Date: 01/20/2016 18:36:11 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_Vouch]') AND type in (N'U'))
DROP TABLE [dbo].[BorrowLoan_Vouch]
GO
/****** Object:  Table [dbo].[Member_BorrowInfo]    Script Date: 01/20/2016 18:36:11 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Member_BorrowInfo]') AND type in (N'U'))
DROP TABLE [dbo].[Member_BorrowInfo]
GO
/****** Object:  Table [dbo].[Member_CreditLog]    Script Date: 01/20/2016 18:36:11 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Member_CreditLog]') AND type in (N'U'))
DROP TABLE [dbo].[Member_CreditLog]
GO
/****** Object:  Table [dbo].[Member_Expose]    Script Date: 01/20/2016 18:36:11 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Member_Expose]') AND type in (N'U'))
DROP TABLE [dbo].[Member_Expose]
GO
/****** Object:  Table [dbo].[Member_LoginHistory]    Script Date: 01/20/2016 18:36:11 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Member_LoginHistory]') AND type in (N'U'))
DROP TABLE [dbo].[Member_LoginHistory]
GO
/****** Object:  Table [dbo].[Member_Message]    Script Date: 01/20/2016 18:36:11 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Member_Message]') AND type in (N'U'))
DROP TABLE [dbo].[Member_Message]
GO
/****** Object:  Table [dbo].[Member_QuotaLog]    Script Date: 01/20/2016 18:36:10 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Member_QuotaLog]') AND type in (N'U'))
DROP TABLE [dbo].[Member_QuotaLog]
GO
/****** Object:  Table [dbo].[Member_Related]    Script Date: 01/20/2016 18:36:10 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Member_Related]') AND type in (N'U'))
DROP TABLE [dbo].[Member_Related]
GO
/****** Object:  Table [dbo].[Member_ScoreLog]    Script Date: 01/20/2016 18:36:10 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Member_ScoreLog]') AND type in (N'U'))
DROP TABLE [dbo].[Member_ScoreLog]
GO
/****** Object:  Table [dbo].[Member_User]    Script Date: 01/20/2016 18:36:10 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Member_User]') AND type in (N'U'))
DROP TABLE [dbo].[Member_User]
GO
/****** Object:  Table [dbo].[Member_UserAdminMapping]    Script Date: 01/20/2016 18:36:10 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Member_UserAdminMapping]') AND type in (N'U'))
DROP TABLE [dbo].[Member_UserAdminMapping]
GO
/****** Object:  Table [dbo].[Member_UserOAuth]    Script Date: 01/20/2016 18:36:10 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Member_UserOAuth]') AND type in (N'U'))
DROP TABLE [dbo].[Member_UserOAuth]
GO
/****** Object:  Table [dbo].[Shop_Category]    Script Date: 01/20/2016 18:36:10 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Shop_Category]') AND type in (N'U'))
DROP TABLE [dbo].[Shop_Category]
GO
/****** Object:  Table [dbo].[Shop_Product]    Script Date: 01/20/2016 18:36:10 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Shop_Product]') AND type in (N'U'))
DROP TABLE [dbo].[Shop_Product]
GO
/****** Object:  Table [dbo].[Shop_UserApplyLog]    Script Date: 01/20/2016 18:36:10 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Shop_UserApplyLog]') AND type in (N'U'))
DROP TABLE [dbo].[Shop_UserApplyLog]
GO
/****** Object:  Table [dbo].[Sys_AdCode]    Script Date: 01/20/2016 18:36:10 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_AdCode]') AND type in (N'U'))
DROP TABLE [dbo].[Sys_AdCode]
GO
/****** Object:  Table [dbo].[Sys_Admin]    Script Date: 01/20/2016 18:36:09 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_Admin]') AND type in (N'U'))
DROP TABLE [dbo].[Sys_Admin]
GO
/****** Object:  Table [dbo].[Sys_AdminGroup]    Script Date: 01/20/2016 18:36:09 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_AdminGroup]') AND type in (N'U'))
DROP TABLE [dbo].[Sys_AdminGroup]
GO
/****** Object:  Table [dbo].[Sys_AdminLog]    Script Date: 01/20/2016 18:36:09 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_AdminLog]') AND type in (N'U'))
DROP TABLE [dbo].[Sys_AdminLog]
GO
/****** Object:  Table [dbo].[Sys_AdPosition]    Script Date: 01/20/2016 18:36:09 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_AdPosition]') AND type in (N'U'))
DROP TABLE [dbo].[Sys_AdPosition]
GO
/****** Object:  Table [dbo].[Sys_Area]    Script Date: 01/20/2016 18:36:09 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_Area]') AND type in (N'U'))
DROP TABLE [dbo].[Sys_Area]
GO
/****** Object:  Table [dbo].[Sys_AutoBidType]    Script Date: 01/20/2016 18:36:09 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_AutoBidType]') AND type in (N'U'))
DROP TABLE [dbo].[Sys_AutoBidType]
GO
/****** Object:  Table [dbo].[Sys_BaseForm]    Script Date: 01/20/2016 18:36:09 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_BaseForm]') AND type in (N'U'))
DROP TABLE [dbo].[Sys_BaseForm]
GO
/****** Object:  Table [dbo].[Sys_BorrowInfoType]    Script Date: 01/20/2016 18:36:09 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_BorrowInfoType]') AND type in (N'U'))
DROP TABLE [dbo].[Sys_BorrowInfoType]
GO
/****** Object:  Table [dbo].[Sys_BorrowType]    Script Date: 01/20/2016 18:36:09 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_BorrowType]') AND type in (N'U'))
DROP TABLE [dbo].[Sys_BorrowType]
GO
/****** Object:  Table [dbo].[Sys_CreditLevel]    Script Date: 01/20/2016 18:36:08 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_CreditLevel]') AND type in (N'U'))
DROP TABLE [dbo].[Sys_CreditLevel]
GO
/****** Object:  Table [dbo].[Sys_GlobalSetting]    Script Date: 01/20/2016 18:36:08 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_GlobalSetting]') AND type in (N'U'))
DROP TABLE [dbo].[Sys_GlobalSetting]
GO
/****** Object:  Table [dbo].[Sys_GuestBook]    Script Date: 01/20/2016 18:36:08 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_GuestBook]') AND type in (N'U'))
DROP TABLE [dbo].[Sys_GuestBook]
GO
/****** Object:  Table [dbo].[Sys_ImageValidCode]    Script Date: 01/20/2016 18:36:08 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_ImageValidCode]') AND type in (N'U'))
DROP TABLE [dbo].[Sys_ImageValidCode]
GO
/****** Object:  Table [dbo].[Sys_Link]    Script Date: 01/20/2016 18:36:08 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_Link]') AND type in (N'U'))
DROP TABLE [dbo].[Sys_Link]
GO
/****** Object:  Table [dbo].[Sys_Notice]    Script Date: 01/20/2016 18:36:08 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_Notice]') AND type in (N'U'))
DROP TABLE [dbo].[Sys_Notice]
GO
/****** Object:  Table [dbo].[Sys_OfflinePayment]    Script Date: 01/20/2016 18:36:08 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_OfflinePayment]') AND type in (N'U'))
DROP TABLE [dbo].[Sys_OfflinePayment]
GO
/****** Object:  Table [dbo].[Sys_OnlinePayment]    Script Date: 01/20/2016 18:36:08 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_OnlinePayment]') AND type in (N'U'))
DROP TABLE [dbo].[Sys_OnlinePayment]
GO
/****** Object:  Table [dbo].[Sys_SMSTask]    Script Date: 01/20/2016 18:36:08 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_SMSTask]') AND type in (N'U'))
DROP TABLE [dbo].[Sys_SMSTask]
GO
/****** Object:  Table [dbo].[Sys_SMSTaskLog]    Script Date: 01/20/2016 18:36:07 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_SMSTaskLog]') AND type in (N'U'))
DROP TABLE [dbo].[Sys_SMSTaskLog]
GO
/****** Object:  Table [dbo].[Sys_UserGroup]    Script Date: 01/20/2016 18:36:07 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_UserGroup]') AND type in (N'U'))
DROP TABLE [dbo].[Sys_UserGroup]
GO
/****** Object:  Table [dbo].[Sys_UserType]    Script Date: 01/20/2016 18:36:07 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_UserType]') AND type in (N'U'))
DROP TABLE [dbo].[Sys_UserType]
GO
/****** Object:  Table [dbo].[Sys_ValidCode]    Script Date: 01/20/2016 18:36:07 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_ValidCode]') AND type in (N'U'))
DROP TABLE [dbo].[Sys_ValidCode]
GO
/****** Object:  Table [dbo].[Sys_VouchCompany]    Script Date: 01/20/2016 18:36:07 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_VouchCompany]') AND type in (N'U'))
DROP TABLE [dbo].[Sys_VouchCompany]
GO
/****** Object:  Table [dbo].[Sys_VouchCompany]    Script Date: 01/20/2016 18:36:07 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_VouchCompany]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Sys_VouchCompany](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](100) NOT NULL,
	[SaleNumber] [nvarchar](100) NOT NULL,
	[Logo] [nvarchar](100) NOT NULL,
	[Range] [nvarchar](max) NOT NULL,
	[ContactName] [nvarchar](100) NOT NULL,
	[ContactPhone] [nvarchar](50) NOT NULL,
	[Address] [nvarchar](100) NOT NULL,
	[Description] [nvarchar](max) NOT NULL,
	[Bond] [decimal](18, 3) NOT NULL,
	[CreateAt] [datetime] NOT NULL,
	[Active] [bit] NOT NULL,
	[VerifyById] [bigint] NOT NULL,
	[VerifyRemark] [nvarchar](50) NOT NULL,
	[VerifyAt] [datetime] NULL,
	[AreaId] [bigint] NULL,
	[ProvinceId] [bigint] NULL,
	[CityId] [bigint] NULL,
 CONSTRAINT [PK_System_VouchCompany] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[Sys_ValidCode]    Script Date: 01/20/2016 18:36:07 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_ValidCode]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Sys_ValidCode](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[Target] [nvarchar](100) NOT NULL,
	[Code] [nvarchar](6) NOT NULL,
	[IP] [nvarchar](15) NOT NULL,
	[CreateAt] [datetime] NOT NULL,
 CONSTRAINT [PK_Sys_ValidCode] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[Sys_UserType]    Script Date: 01/20/2016 18:36:07 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_UserType]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Sys_UserType](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](50) NOT NULL,
	[Type] [int] NOT NULL,
	[CanReg] [bit] NOT NULL,
	[CanVouch] [bit] NOT NULL,
	[OrderBy] [int] NOT NULL,
	[UserInfoFormJson] [nvarchar](max) NULL,
	[PermissionJson] [nvarchar](max) NULL,
	[Remark] [nvarchar](max) NOT NULL,
 CONSTRAINT [PK_System_UserType] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[Sys_UserGroup]    Script Date: 01/20/2016 18:36:07 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_UserGroup]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Sys_UserGroup](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[UserTypeId] [bigint] NOT NULL,
	[Name] [nvarchar](50) NOT NULL,
	[Icon] [nvarchar](100) NOT NULL,
	[GroupLevel] [int] NOT NULL,
	[BorrowFilterJson] [nvarchar](max) NULL,
	[AutoBid] [bit] NOT NULL,
	[AutoBidPriority] [int] NOT NULL,
	[AutoBidMaxRecored] [int] NOT NULL,
	[CanRecommend] [bit] NOT NULL,
	[RecommendRatio] [decimal](18, 8) NOT NULL,
	[CanReserve] [bit] NOT NULL,
	[CanBid] [bit] NOT NULL,
	[CanUpGroup] [bit] NOT NULL,
	[IsDefaultGroup] [bit] NOT NULL,
	[SupportExtractionCashJson] [nvarchar](max) NOT NULL,
	[CanUpByAmount] [bit] NOT NULL,
	[UpByAmountJson] [nvarchar](max) NOT NULL,
	[CanUpByScore] [bit] NOT NULL,
	[UpByScoreJson] [nvarchar](max) NOT NULL,
	[LoadFee] [decimal](18, 8) NOT NULL,
	[InterestFee] [decimal](18, 8) NOT NULL,
	[TransferFee] [decimal](18, 8) NOT NULL,
	[OnlineAccountExtracFeeRatio] [decimal](18, 8) NOT NULL,
	[OfflineAccountExtracFeeRatio] [decimal](18, 8) NOT NULL,
	[LoanAccountExtracFeeRatio] [decimal](18, 8) NOT NULL,
	[ReceiveAccountExtracFeeRatio] [decimal](18, 8) NOT NULL,
	[RewardAccountExtracFeeRatio] [decimal](18, 8) NOT NULL,
	[RemindJson] [nvarchar](max) NULL,
	[Description] [nvarchar](max) NOT NULL,
 CONSTRAINT [PK_System_UserGroup] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[Sys_SMSTaskLog]    Script Date: 01/20/2016 18:36:07 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_SMSTaskLog]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Sys_SMSTaskLog](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[SendAt] [datetime] NOT NULL,
	[Phone] [nvarchar](50) NOT NULL,
	[UserName] [nvarchar](50) NOT NULL,
	[Detail] [nvarchar](max) NOT NULL,
	[CreateAt] [datetime] NOT NULL,
	[SMSTaskId] [bigint] NULL,
 CONSTRAINT [PK_Sys_SMSLog] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[Sys_SMSTask]    Script Date: 01/20/2016 18:36:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_SMSTask]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Sys_SMSTask](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[Target] [nvarchar](max) NOT NULL,
	[Detail] [nvarchar](max) NOT NULL,
	[SendAt] [datetime] NOT NULL,
	[CreateAt] [datetime] NOT NULL,
	[ActionAt] [datetime] NULL,
 CONSTRAINT [PK_Sys_SMS] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[Sys_OnlinePayment]    Script Date: 01/20/2016 18:36:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_OnlinePayment]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Sys_OnlinePayment](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[CallCode] [nvarchar](20) NOT NULL,
	[Name] [nvarchar](50) NOT NULL,
	[PlatformLogo] [nvarchar](100) NOT NULL,
	[Description] [nvarchar](max) NOT NULL,
	[SettingJson] [nvarchar](max) NOT NULL,
	[DirectJson] [nvarchar](max) NOT NULL,
	[Direct] [bit] NOT NULL,
	[Active] [bit] NOT NULL,
	[OrderBy] [int] NOT NULL,
	[CreateAt] [datetime] NOT NULL,
 CONSTRAINT [PK_Sys_OnlinePayment] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[Sys_OfflinePayment]    Script Date: 01/20/2016 18:36:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_OfflinePayment]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Sys_OfflinePayment](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[BankName] [nvarchar](50) NOT NULL,
	[CardNo] [nvarchar](50) NOT NULL,
	[AccountName] [nvarchar](50) NOT NULL,
	[AreaName] [nvarchar](100) NOT NULL,
	[Branch] [nvarchar](50) NOT NULL,
	[Active] [bit] NOT NULL,
	[OrderBy] [int] NOT NULL,
	[CreateAt] [datetime] NOT NULL,
 CONSTRAINT [PK_Sys_OfflinePayment] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[Sys_Notice]    Script Date: 01/20/2016 18:36:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_Notice]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Sys_Notice](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[Title] [nvarchar](100) NOT NULL,
	[Detail] [nvarchar](max) NOT NULL,
	[StartAt] [datetime] NOT NULL,
	[EndAt] [datetime] NULL,
	[CreateAt] [datetime] NOT NULL,
	[AdminId] [bigint] NOT NULL,
	[AdminName] [nvarchar](50) NOT NULL,
	[TargetGroupIds] [nvarchar](max) NULL,
	[OrderBy] [int] NOT NULL,
 CONSTRAINT [PK_Sys_Notice] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[Sys_Link]    Script Date: 01/20/2016 18:36:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_Link]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Sys_Link](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[LinkName] [nvarchar](50) NOT NULL,
	[LinkUrl] [nvarchar](200) NOT NULL,
	[Description] [nvarchar](max) NOT NULL,
	[IsDisplay] [bit] NOT NULL,
	[OrderBy] [int] NOT NULL,
	[Logo] [nvarchar](100) NOT NULL,
	[CreateAt] [datetime] NOT NULL,
 CONSTRAINT [PK_Sys_Link] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[Sys_ImageValidCode]    Script Date: 01/20/2016 18:36:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_ImageValidCode]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Sys_ImageValidCode](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[Code] [nvarchar](10) NOT NULL,
	[UseAt] [datetime] NULL,
	[Used] [bit] NOT NULL,
 CONSTRAINT [PK_Sys_ImageValidCode] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[Sys_GuestBook]    Script Date: 01/20/2016 18:36:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_GuestBook]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Sys_GuestBook](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[Nickname] [nvarchar](50) NOT NULL,
	[Type] [nvarchar](50) NOT NULL,
	[IsDisplay] [bit] NOT NULL,
	[Contact] [nvarchar](500) NOT NULL,
	[Detail] [nvarchar](max) NOT NULL,
	[Reply] [nvarchar](max) NOT NULL,
	[ReplyAt] [datetime] NULL,
	[ReplyAdminId] [bigint] NULL,
	[ReplyAdminName] [nvarchar](50) NOT NULL,
	[IP] [nvarchar](15) NOT NULL,
	[CreateAt] [datetime] NOT NULL,
 CONSTRAINT [PK_Sys_GuestBook] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[Sys_GlobalSetting]    Script Date: 01/20/2016 18:36:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_GlobalSetting]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Sys_GlobalSetting](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](50) NOT NULL,
	[Value] [nvarchar](max) NOT NULL,
 CONSTRAINT [PK_System_GlobalSetting] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[Sys_CreditLevel]    Script Date: 01/20/2016 18:36:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_CreditLevel]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Sys_CreditLevel](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](50) NOT NULL,
	[MinValue] [int] NOT NULL,
	[Icon] [nvarchar](100) NOT NULL,
	[Description] [nvarchar](max) NOT NULL,
	[CreditQuotaJson] [nvarchar](max) NOT NULL,
	[PayAndReceiveRateJson] [nvarchar](max) NOT NULL,
 CONSTRAINT [PK_System_CreditLevel] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[Sys_BorrowType]    Script Date: 01/20/2016 18:36:09 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_BorrowType]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Sys_BorrowType](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](50) NOT NULL,
	[Icon] [nvarchar](100) NOT NULL,
	[Cover] [nvarchar](100) NOT NULL,
	[Active] [bit] NOT NULL,
	[OrderBy] [int] NOT NULL,
	[LoanTimeJson] [nvarchar](max) NOT NULL,
	[MinAmount] [decimal](18, 3) NOT NULL,
	[MaxAmount] [decimal](18, 3) NOT NULL,
	[MinInterest] [decimal](18, 8) NOT NULL,
	[MaxInterest] [decimal](18, 8) NOT NULL,
	[InterestPeriod] [int] NOT NULL,
	[InterestType] [int] NOT NULL,
	[InterestStartType] [int] NOT NULL,
	[BidPushAccount] [bit] NOT NULL,
	[RepaymentJson] [nvarchar](max) NOT NULL,
	[MaxBidDay] [int] NOT NULL,
	[SystemPublish] [bit] NOT NULL,
	[Description] [nvarchar](max) NOT NULL,
	[ValidInfoTypeIds] [nvarchar](max) NOT NULL,
	[CheckQuotaType] [int] NOT NULL,
	[CheckWaitReceive] [decimal](18, 8) NOT NULL,
	[CheckWaitRepayment] [decimal](18, 8) NOT NULL,
	[CanTransfer] [bit] NOT NULL,
	[TransferMinHoldDay] [int] NOT NULL,
	[TransferMinAmount] [decimal](18, 3) NOT NULL,
	[TransferMinPeriod] [int] NOT NULL,
	[TransferCanSplit] [bit] NOT NULL,
	[TransferCanMultiBuyer] [bit] NOT NULL,
	[TransferUpRate] [decimal](18, 8) NULL,
	[TransferDownRate] [decimal](18, 8) NULL,
	[CreditLevelId] [bigint] NOT NULL,
	[AdvanceRepay] [int] NOT NULL,
	[AdvanceRepayOutDay] [int] NOT NULL,
	[AdvanceRepayOutRate] [decimal](18, 8) NOT NULL,
	[ByStep] [bit] NOT NULL,
	[StepAmount] [decimal](18, 3) NOT NULL,
	[SupportRecommend] [bit] NOT NULL,
	[AutoAddPass] [bit] NOT NULL,
	[AutoFullPass] [bit] NOT NULL,
	[SupportNoFullPass] [bit] NOT NULL,
	[OverdueInDay] [int] NOT NULL,
	[OverdueOutRate] [decimal](18, 8) NOT NULL,
	[OverdueInRate] [decimal](18, 8) NOT NULL,
	[BidScoreRate] [decimal](18, 8) NOT NULL,
	[RepayCreditRate] [decimal](18, 8) NOT NULL,
	[OverdueCreditRate] [decimal](18, 8) NOT NULL,
	[GradeLevel] [int] NULL,
	[OnsiteValid] [bit] NOT NULL,
	[MarginRatio] [decimal](18, 8) NOT NULL,
	[BorrowAgreement] [nvarchar](max) NOT NULL,
	[TransferAgreement] [nvarchar](max) NOT NULL,
 CONSTRAINT [PK_System_BorrowType] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[Sys_BorrowInfoType]    Script Date: 01/20/2016 18:36:09 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_BorrowInfoType]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Sys_BorrowInfoType](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](50) NOT NULL,
	[FormJson] [nvarchar](max) NULL,
	[Active] [bit] NOT NULL,
	[Remark] [nvarchar](max) NOT NULL,
 CONSTRAINT [PK_Sys_BorrowInfoType] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[Sys_BaseForm]    Script Date: 01/20/2016 18:36:09 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_BaseForm]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Sys_BaseForm](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[CallCode] [nvarchar](500) NOT NULL,
	[Name] [nvarchar](50) NOT NULL,
	[ValuesJson] [nvarchar](max) NULL,
	[CreateAt] [datetime] NOT NULL,
 CONSTRAINT [PK_Sys_BaseForm] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[Sys_AutoBidType]    Script Date: 01/20/2016 18:36:09 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_AutoBidType]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Sys_AutoBidType](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](50) NOT NULL,
	[Icon] [nvarchar](100) NOT NULL,
	[Active] [bit] NOT NULL,
	[ValidDateMin] [int] NULL,
	[ValidDateMax] [int] NULL,
	[ValidInterestMin] [decimal](18, 8) NULL,
	[ValidInterestMax] [decimal](18, 8) NULL,
	[AmountMin] [decimal](18, 3) NULL,
	[StepAmount] [decimal](18, 3) NULL,
	[Repayment] [nvarchar](50) NOT NULL,
	[OneBidRate] [decimal](18, 8) NOT NULL,
	[Description] [nvarchar](max) NOT NULL,
	[Detail] [nvarchar](max) NOT NULL,
	[OrderBy] [int] NOT NULL,
	[CreateAt] [datetime] NOT NULL,
 CONSTRAINT [PK_Sys_AutoBidType] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[Sys_Area]    Script Date: 01/20/2016 18:36:09 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_Area]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Sys_Area](
	[Id] [bigint] NOT NULL,
	[Name] [nvarchar](50) NOT NULL,
	[ParentId] [bigint] NOT NULL,
	[Pinyin] [nvarchar](50) NOT NULL,
 CONSTRAINT [PK_System_Area] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[Sys_AdPosition]    Script Date: 01/20/2016 18:36:09 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_AdPosition]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Sys_AdPosition](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[CallCode] [nvarchar](50) NOT NULL,
	[Name] [nvarchar](100) NOT NULL,
	[Width] [int] NOT NULL,
	[Height] [int] NOT NULL,
	[Active] [bit] NOT NULL,
 CONSTRAINT [PK_System_AdPosition] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[Sys_AdminLog]    Script Date: 01/20/2016 18:36:09 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_AdminLog]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Sys_AdminLog](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[AdminId] [bigint] NOT NULL,
	[AdminName] [nvarchar](50) NOT NULL,
	[Operator] [nvarchar](50) NOT NULL,
	[Detail] [nvarchar](max) NOT NULL,
	[CreateAt] [datetime] NOT NULL,
	[IP] [nvarchar](15) NOT NULL,
 CONSTRAINT [PK_System_AdminLog] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[Sys_AdminGroup]    Script Date: 01/20/2016 18:36:09 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_AdminGroup]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Sys_AdminGroup](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](50) NOT NULL,
	[Description] [nvarchar](max) NOT NULL,
	[LoginAreaFilter] [nvarchar](max) NOT NULL,
	[PermissionJson] [nvarchar](max) NOT NULL,
	[CreateAt] [datetime] NOT NULL,
	[ViewOnlyGroup] [bit] NOT NULL,
 CONSTRAINT [PK_System_AdminGroup] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[Sys_Admin]    Script Date: 01/20/2016 18:36:09 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_Admin]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Sys_Admin](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](50) NOT NULL,
	[Password] [nvarchar](60) NOT NULL,
	[PasswordSalt] [nvarchar](16) NOT NULL,
	[GroupId] [bigint] NOT NULL,
	[LoginAreaFilter] [nvarchar](max) NOT NULL,
	[LoginErrorAt] [datetime] NULL,
	[Face] [nvarchar](100) NOT NULL,
	[Email] [nvarchar](100) NOT NULL,
	[Phone] [nvarchar](20) NOT NULL,
	[QQ] [nvarchar](20) NOT NULL,
	[Nickname] [nvarchar](50) NOT NULL,
	[CreateAt] [datetime] NOT NULL,
	[LastLoginAt] [datetime] NULL,
	[PreLoginAt] [datetime] NULL,
	[LastLoginIP] [nvarchar](15) NULL,
	[PreLoginIP] [nvarchar](15) NULL,
	[LoginCount] [int] NOT NULL,
	[IsLock] [bit] NOT NULL,
	[IsService] [bit] NOT NULL,
	[ViewUserOnlySelf] [bit] NOT NULL,
	[ViewOnlySlef] [bit] NOT NULL,
	[LoginErrorCount] [int] NOT NULL,
	[SuperAdmin] [bit] NOT NULL,
	[PermissionJson] [nvarchar](max) NULL,
	[Remark] [nvarchar](max) NOT NULL,
 CONSTRAINT [PK_System_Admin] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY],
 CONSTRAINT [IX_Sys_Admin] UNIQUE NONCLUSTERED 
(
	[Name] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[Sys_AdCode]    Script Date: 01/20/2016 18:36:10 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_AdCode]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Sys_AdCode](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[PositionId] [bigint] NOT NULL,
	[CodeType] [int] NOT NULL,
	[CodeJson] [nvarchar](max) NOT NULL,
	[StartAt] [datetime] NOT NULL,
	[EndAt] [datetime] NULL,
	[Active] [bit] NOT NULL,
	[CreateAt] [datetime] NOT NULL,
	[Priority] [int] NOT NULL,
 CONSTRAINT [PK_System_AdCode] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sys_AdCode]') AND name = N'IX_Sys_AdCode')
CREATE NONCLUSTERED INDEX [IX_Sys_AdCode] ON [dbo].[Sys_AdCode] 
(
	[PositionId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Shop_UserApplyLog]    Script Date: 01/20/2016 18:36:10 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Shop_UserApplyLog]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Shop_UserApplyLog](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[ProductId] [bigint] NOT NULL,
	[ProductName] [nvarchar](100) NOT NULL,
	[Qty] [int] NOT NULL,
	[UserId] [bigint] NOT NULL,
	[UserName] [nvarchar](50) NOT NULL,
	[Nickname] [nvarchar](50) NOT NULL,
	[Score] [int] NOT NULL,
	[Status] [int] NOT NULL,
	[CreateAt] [datetime] NOT NULL,
	[AdminId] [bigint] NULL,
	[AdminName] [nvarchar](50) NOT NULL,
	[AdminProcessAt] [datetime] NULL,
	[Name] [nvarchar](50) NOT NULL,
	[Phone] [nvarchar](100) NOT NULL,
	[ZipCode] [nvarchar](20) NOT NULL,
	[ProvinceId] [bigint] NOT NULL,
	[CityId] [bigint] NOT NULL,
	[AreaId] [bigint] NOT NULL,
	[Address] [nvarchar](100) NOT NULL,
 CONSTRAINT [PK_Shop_UserApplyLog] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Shop_UserApplyLog]') AND name = N'IX_Shop_UserApplyLog')
CREATE NONCLUSTERED INDEX [IX_Shop_UserApplyLog] ON [dbo].[Shop_UserApplyLog] 
(
	[UserId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Shop_Product]    Script Date: 01/20/2016 18:36:10 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Shop_Product]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Shop_Product](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[CategoryId] [bigint] NOT NULL,
	[Name] [nvarchar](100) NOT NULL,
	[MarketPrice] [decimal](18, 3) NULL,
	[Cover] [nvarchar](100) NOT NULL,
	[Score] [int] NOT NULL,
	[Detail] [nvarchar](max) NOT NULL,
	[Active] [bit] NOT NULL,
	[CreateAt] [datetime] NOT NULL,
	[VirtualGoods] [bit] NOT NULL,
	[Stock] [int] NOT NULL,
	[Timestamp] [timestamp] NOT NULL,
 CONSTRAINT [PK_Shop_Product] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Shop_Product]') AND name = N'IX_Shop_Product')
CREATE NONCLUSTERED INDEX [IX_Shop_Product] ON [dbo].[Shop_Product] 
(
	[CategoryId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Shop_Category]    Script Date: 01/20/2016 18:36:10 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Shop_Category]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Shop_Category](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](50) NOT NULL,
	[OrderBy] [int] NOT NULL,
	[Active] [bit] NOT NULL,
 CONSTRAINT [PK_Shop_Category] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[Member_UserOAuth]    Script Date: 01/20/2016 18:36:10 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Member_UserOAuth]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Member_UserOAuth](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[UserId] [bigint] NOT NULL,
	[Supplier] [int] NOT NULL,
	[SupplierKey] [nvarchar](100) NOT NULL,
	[CreateAt] [datetime] NOT NULL,
 CONSTRAINT [PK_Member_UserOAuth] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Member_UserOAuth]') AND name = N'IX_Member_UserOAuth')
CREATE NONCLUSTERED INDEX [IX_Member_UserOAuth] ON [dbo].[Member_UserOAuth] 
(
	[UserId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Member_UserAdminMapping]    Script Date: 01/20/2016 18:36:10 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Member_UserAdminMapping]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Member_UserAdminMapping](
	[Id] [bigint] NOT NULL,
	[SaleId] [bigint] NOT NULL,
	[SaleStartAt] [datetime] NULL,
	[ServiceId] [bigint] NOT NULL,
	[ServiceStartAt] [datetime] NULL,
 CONSTRAINT [PK_Member_UserAdminMapping] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[Member_User]    Script Date: 01/20/2016 18:36:10 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Member_User]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Member_User](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](30) NOT NULL,
	[Nickname] [nvarchar](50) NOT NULL,
	[Password] [nvarchar](60) NOT NULL,
	[PasswordSalt] [nvarchar](16) NOT NULL,
	[PayPassowrdSalt] [nvarchar](16) NULL,
	[PayPassowrd] [nvarchar](60) NULL,
	[UserTypeId] [bigint] NOT NULL,
	[UpGroupId] [bigint] NULL,
	[UpGroupExpires] [datetime] NULL,
	[SafeQuestionJson] [nvarchar](max) NULL,
	[Face] [nvarchar](100) NOT NULL,
	[Email] [nvarchar](100) NOT NULL,
	[Phone] [nvarchar](20) NOT NULL,
	[PhoneValid] [int] NOT NULL,
	[EmailValid] [int] NOT NULL,
	[CreateAt] [datetime] NOT NULL,
	[LastLoginAt] [datetime] NULL,
	[PreLoginAt] [datetime] NULL,
	[RegIP] [nvarchar](15) NOT NULL,
	[LastLoginIP] [nvarchar](15) NULL,
	[PreLoginIP] [nvarchar](15) NULL,
	[LoginCount] [int] NOT NULL,
	[Score] [bigint] NOT NULL,
	[Credit] [int] NOT NULL,
	[IsLock] [bit] NOT NULL,
	[Signature] [nvarchar](max) NOT NULL,
	[LoginErrorCount] [int] NOT NULL,
	[LoginErrorAt] [datetime] NULL,
	[PayErrorCount] [int] NOT NULL,
	[PayErrorAt] [datetime] NULL,
	[RecommendBy] [bigint] NOT NULL,
	[GradeLevel] [int] NOT NULL,
	[ProvinceId] [bigint] NULL,
	[CityId] [bigint] NULL,
	[AreaId] [bigint] NULL,
	[RemindJson] [nvarchar](max) NULL,
	[Company] [nvarchar](50) NOT NULL,
	[SaleNumber] [nvarchar](50) NOT NULL,
	[SalePhoto] [nvarchar](100) NOT NULL,
	[RealName] [nvarchar](50) NOT NULL,
	[RealNameValid] [int] NOT NULL,
	[OnsiteValid] [int] NOT NULL,
	[CardNumber] [nvarchar](50) NOT NULL,
	[CardPhoto1] [nvarchar](100) NOT NULL,
	[CardPhoto2] [nvarchar](100) NOT NULL,
	[Sex] [bit] NULL,
	[Birthday] [datetime] NULL,
	[Address] [nvarchar](100) NOT NULL,
	[Remark] [nvarchar](max) NOT NULL,
	[UserInfoJson] [nvarchar](max) NULL,
	[UserInfoWaitValid] [bit] NOT NULL,
	[BaseValidJson] [nvarchar](max) NULL,
	[OtherHostingId] [nvarchar](50) NOT NULL,
 CONSTRAINT [PK_Member_User] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY],
 CONSTRAINT [IX_Member_User] UNIQUE NONCLUSTERED 
(
	[Name] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[Member_ScoreLog]    Script Date: 01/20/2016 18:36:10 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Member_ScoreLog]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Member_ScoreLog](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[UserId] [bigint] NOT NULL,
	[UserName] [nvarchar](50) NOT NULL,
	[Value] [int] NOT NULL,
	[Op] [nvarchar](max) NOT NULL,
	[CreateAt] [datetime] NOT NULL,
 CONSTRAINT [PK_Member_ScoreLog] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Member_ScoreLog]') AND name = N'IX_Member_ScoreLog')
CREATE NONCLUSTERED INDEX [IX_Member_ScoreLog] ON [dbo].[Member_ScoreLog] 
(
	[UserId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Member_Related]    Script Date: 01/20/2016 18:36:10 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Member_Related]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Member_Related](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[UserId] [bigint] NOT NULL,
	[TargetId] [bigint] NOT NULL,
	[Type] [int] NOT NULL,
	[GroupId] [bigint] NULL,
	[Remark] [nvarchar](50) NOT NULL,
	[CreateAt] [datetime] NOT NULL,
 CONSTRAINT [PK_Member_Related] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Member_Related]') AND name = N'IX_Member_Related')
CREATE NONCLUSTERED INDEX [IX_Member_Related] ON [dbo].[Member_Related] 
(
	[UserId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Member_Related]') AND name = N'IX_Member_Related_1')
CREATE NONCLUSTERED INDEX [IX_Member_Related_1] ON [dbo].[Member_Related] 
(
	[TargetId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Member_QuotaLog]    Script Date: 01/20/2016 18:36:10 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Member_QuotaLog]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Member_QuotaLog](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[UserId] [bigint] NOT NULL,
	[UserName] [nvarchar](30) NOT NULL,
	[BorrowTypeId] [bigint] NOT NULL,
	[BorrowTypeName] [nvarchar](50) NOT NULL,
	[ApplyAmount] [decimal](18, 3) NOT NULL,
	[PassAmount] [decimal](18, 3) NULL,
	[QuotaOld] [decimal](18, 3) NOT NULL,
	[FromType] [int] NOT NULL,
	[ApplyRemark] [nvarchar](max) NOT NULL,
	[Status] [int] NOT NULL,
	[Expires] [datetime] NULL,
	[VerifyAdminId] [bigint] NULL,
	[VerifyAdminName] [nvarchar](50) NOT NULL,
	[VerifyAt] [datetime] NULL,
	[VerifyRemark] [nvarchar](max) NOT NULL,
	[CreateAt] [datetime] NOT NULL,
 CONSTRAINT [PK_Member_QuotaApply] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Member_QuotaLog]') AND name = N'IX_Member_QuotaLog')
CREATE NONCLUSTERED INDEX [IX_Member_QuotaLog] ON [dbo].[Member_QuotaLog] 
(
	[UserId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Member_Message]    Script Date: 01/20/2016 18:36:11 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Member_Message]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Member_Message](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[UserId] [bigint] NOT NULL,
	[UserName] [nvarchar](50) NOT NULL,
	[TargetId] [bigint] NOT NULL,
	[TargetName] [nvarchar](50) NOT NULL,
	[MessagesJson] [nvarchar](max) NOT NULL,
	[LastActiveAt] [datetime] NOT NULL,
	[HaveNew] [bit] NOT NULL,
 CONSTRAINT [PK_Member_Message] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Member_Message]') AND name = N'IX_Member_Message')
CREATE NONCLUSTERED INDEX [IX_Member_Message] ON [dbo].[Member_Message] 
(
	[UserId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Member_Message]') AND name = N'IX_Member_Message_1')
CREATE NONCLUSTERED INDEX [IX_Member_Message_1] ON [dbo].[Member_Message] 
(
	[TargetId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Member_LoginHistory]    Script Date: 01/20/2016 18:36:11 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Member_LoginHistory]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Member_LoginHistory](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[UserId] [bigint] NOT NULL,
	[UserName] [nvarchar](50) NOT NULL,
	[LoginIP] [nvarchar](15) NOT NULL,
	[Address] [nvarchar](100) NOT NULL,
	[LoginAt] [datetime] NOT NULL,
 CONSTRAINT [PK_Member_LoginHistory] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Member_LoginHistory]') AND name = N'IX_Member_LoginHistory')
CREATE NONCLUSTERED INDEX [IX_Member_LoginHistory] ON [dbo].[Member_LoginHistory] 
(
	[UserId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Member_Expose]    Script Date: 01/20/2016 18:36:11 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Member_Expose]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Member_Expose](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[UserId] [bigint] NOT NULL,
	[UserName] [nvarchar](50) NOT NULL,
	[Detail] [nvarchar](max) NOT NULL,
	[IP] [nvarchar](15) NOT NULL,
	[CreateAt] [datetime] NOT NULL,
	[Email] [nvarchar](100) NOT NULL,
	[Phone] [nvarchar](50) NOT NULL,
	[Name] [nvarchar](50) NOT NULL,
	[AdminName] [nvarchar](50) NOT NULL,
	[AdminAt] [datetime] NULL,
	[AdminId] [bigint] NULL,
	[Status] [int] NOT NULL,
 CONSTRAINT [PK_Member_Expose] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[Member_CreditLog]    Script Date: 01/20/2016 18:36:11 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Member_CreditLog]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Member_CreditLog](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[UserId] [bigint] NOT NULL,
	[UserName] [nvarchar](50) NOT NULL,
	[Value] [int] NOT NULL,
	[Op] [nvarchar](50) NOT NULL,
	[CreateAt] [datetime] NOT NULL,
 CONSTRAINT [PK_Member_CreditLog] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Member_CreditLog]') AND name = N'IX_Member_CreditLog')
CREATE NONCLUSTERED INDEX [IX_Member_CreditLog] ON [dbo].[Member_CreditLog] 
(
	[UserId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Member_BorrowInfo]    Script Date: 01/20/2016 18:36:11 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Member_BorrowInfo]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Member_BorrowInfo](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[UserId] [bigint] NOT NULL,
	[UserName] [nvarchar](50) NOT NULL,
	[Name] [nvarchar](100) NOT NULL,
	[MarketPrice] [decimal](18, 3) NOT NULL,
	[AssessmentPrice] [decimal](18, 3) NOT NULL,
	[Quota] [decimal](18, 3) NOT NULL,
	[Expires] [datetime] NULL,
	[Status] [int] NOT NULL,
	[ValidBy] [nvarchar](50) NOT NULL,
	[ValidAt] [datetime] NULL,
	[ValidRemark] [nvarchar](max) NOT NULL,
	[QuotaBy] [nvarchar](50) NOT NULL,
	[QuotaAt] [datetime] NULL,
	[CreateAt] [datetime] NOT NULL,
	[BorrowInfoTypeId] [bigint] NOT NULL,
	[BorrowInfoJson] [nvarchar](max) NULL,
 CONSTRAINT [PK_Member_Mortgage] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Member_BorrowInfo]') AND name = N'IX_Member_BorrowInfo')
CREATE NONCLUSTERED INDEX [IX_Member_BorrowInfo] ON [dbo].[Member_BorrowInfo] 
(
	[UserId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[BorrowLoan_Vouch]    Script Date: 01/20/2016 18:36:11 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_Vouch]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[BorrowLoan_Vouch](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[UserId] [bigint] NOT NULL,
	[UserName] [nvarchar](100) NOT NULL,
	[BorrowId] [bigint] NOT NULL,
	[BorrowName] [nvarchar](100) NOT NULL,
	[BorrowTypeId] [bigint] NOT NULL,
	[Amount] [decimal](18, 3) NOT NULL,
	[BidReward] [decimal](18, 3) NOT NULL,
	[OnlineAccount] [decimal](18, 3) NOT NULL,
	[OfflineAccount] [decimal](18, 3) NOT NULL,
	[ReceiveAccount] [decimal](18, 3) NOT NULL,
	[LoanAccount] [decimal](18, 3) NOT NULL,
	[RewardAccount] [decimal](18, 3) NOT NULL,
	[CreateAt] [datetime] NOT NULL,
 CONSTRAINT [PK_BorrowLoan_Vouch] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[BorrowLoan_TransferLog]    Script Date: 01/20/2016 18:36:11 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_TransferLog]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[BorrowLoan_TransferLog](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[FromUserId] [bigint] NOT NULL,
	[FromUserName] [nvarchar](50) NOT NULL,
	[FromNickname] [nvarchar](50) NOT NULL,
	[ToUserId] [bigint] NOT NULL,
	[ToUserName] [nvarchar](50) NOT NULL,
	[ToNickname] [nvarchar](50) NOT NULL,
	[BorrowId] [bigint] NOT NULL,
	[BorrowName] [nvarchar](100) NOT NULL,
	[TransferId] [bigint] NOT NULL,
	[TransferName] [nvarchar](100) NOT NULL,
	[Amount] [decimal](18, 3) NOT NULL,
	[UpDownAmount] [decimal](18, 3) NOT NULL,
	[CreateAt] [datetime] NOT NULL,
 CONSTRAINT [PK_BorrowLoan_TransferLog] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_TransferLog]') AND name = N'IX_BorrowLoan_TransferLog')
CREATE NONCLUSTERED INDEX [IX_BorrowLoan_TransferLog] ON [dbo].[BorrowLoan_TransferLog] 
(
	[TransferId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[BorrowLoan_Transfer]    Script Date: 01/20/2016 18:36:11 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_Transfer]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[BorrowLoan_Transfer](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[UserId] [bigint] NOT NULL,
	[UserName] [nvarchar](50) NOT NULL,
	[Nickname] [nvarchar](50) NOT NULL,
	[Name] [nvarchar](100) NOT NULL,
	[Status] [int] NOT NULL,
	[BorrowId] [bigint] NOT NULL,
	[BorrowName] [nvarchar](100) NOT NULL,
	[BorrowTypeId] [bigint] NOT NULL,
	[BidId] [bigint] NOT NULL,
	[EndAt] [datetime] NULL,
	[Amount] [decimal](18, 3) NOT NULL,
	[UpDownAmount] [decimal](18, 3) NOT NULL,
	[Interest] [decimal](18, 3) NOT NULL,
	[OrderBy] [int] NOT NULL,
	[PeriodCount] [int] NOT NULL,
	[BidAmountCount] [decimal](18, 3) NOT NULL,
	[BidUserCount] [int] NOT NULL,
	[CreateAt] [datetime] NOT NULL,
	[Timestamp] [timestamp] NOT NULL,
	[AreaId] [bigint] NOT NULL,
	[ProvinceId] [bigint] NOT NULL,
	[CityId] [bigint] NOT NULL,
	[TransferFee] [decimal](18, 8) NOT NULL,
 CONSTRAINT [PK_BorrowLoan_Transter] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[BorrowLoan_ReservationLog]    Script Date: 01/20/2016 18:36:11 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_ReservationLog]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[BorrowLoan_ReservationLog](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[ReservationId] [bigint] NOT NULL,
	[UserId] [bigint] NOT NULL,
	[UserName] [nvarchar](50) NOT NULL,
	[Nickname] [nvarchar](50) NOT NULL,
	[Amount] [decimal](18, 3) NOT NULL,
	[TempHoldId] [bigint] NOT NULL,
	[CreateAt] [datetime] NOT NULL,
	[Bided] [bit] NOT NULL,
 CONSTRAINT [PK_BorrowLoan_ReservationLog] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_ReservationLog]') AND name = N'IX_BorrowLoan_ReservationLog')
CREATE NONCLUSTERED INDEX [IX_BorrowLoan_ReservationLog] ON [dbo].[BorrowLoan_ReservationLog] 
(
	[ReservationId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[BorrowLoan_ReservationInfo]    Script Date: 01/20/2016 18:36:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_ReservationInfo]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[BorrowLoan_ReservationInfo](
	[Id] [bigint] NOT NULL,
	[UserName] [nvarchar](50) NOT NULL,
	[Amount] [decimal](18, 3) NOT NULL,
	[Expires] [datetime] NULL,
	[Remark] [nvarchar](max) NOT NULL,
	[LastAt] [datetime] NOT NULL,
 CONSTRAINT [PK_BorrowLoan_ReservationInfo] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[BorrowLoan_Reservation]    Script Date: 01/20/2016 18:36:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_Reservation]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[BorrowLoan_Reservation](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](100) NOT NULL,
	[Cover] [nvarchar](100) NOT NULL,
	[Amount] [decimal](18, 3) NOT NULL,
	[MinAmount] [decimal](18, 3) NOT NULL,
	[MaxAmount] [decimal](18, 3) NULL,
	[StepAmount] [decimal](18, 3) NULL,
	[BailRate] [decimal](18, 8) NOT NULL,
	[BailDeductionRate] [decimal](18, 8) NOT NULL,
	[EndAt] [datetime] NOT NULL,
	[Description] [nvarchar](max) NOT NULL,
	[Interest] [decimal](18, 8) NOT NULL,
	[LoanDate] [int] NOT NULL,
	[LoanDateUnit] [int] NOT NULL,
	[Repayment] [nvarchar](50) NOT NULL,
	[Detail] [nvarchar](max) NOT NULL,
	[CreateAt] [datetime] NOT NULL,
 CONSTRAINT [PK_BorrowLoad_Reserve] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[BorrowLoan_Repay]    Script Date: 01/20/2016 18:36:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_Repay]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[BorrowLoan_Repay](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[UserId] [bigint] NOT NULL,
	[UserName] [nvarchar](50) NOT NULL,
	[BorrowId] [bigint] NOT NULL,
	[BorrowName] [nvarchar](50) NOT NULL,
	[BorrowTypeId] [bigint] NOT NULL,
	[Period] [int] NOT NULL,
	[ShouldRepayAt] [datetime] NOT NULL,
	[ActualRepayAt] [datetime] NULL,
	[ShouldRepayPrincipal] [decimal](18, 3) NOT NULL,
	[ActuaRepayPrincipal] [decimal](18, 3) NOT NULL,
	[ShouldRepayInterest] [decimal](18, 3) NOT NULL,
	[ActuaRepayInterest] [decimal](18, 3) NOT NULL,
	[ActuaRepayOverdue] [decimal](18, 3) NOT NULL,
	[ShouldRepayOverdue] [decimal](18, 3) NOT NULL,
	[AdvanceRepayViolate] [decimal](18, 3) NOT NULL,
	[ShouldRepayFee] [decimal](18, 3) NOT NULL,
	[ActuaRepayFee] [decimal](18, 3) NOT NULL,
	[Status] [int] NOT NULL,
	[ActuaRepayUserId] [bigint] NULL,
	[ActuaRepayUserName] [nvarchar](100) NOT NULL,
	[CreateAt] [datetime] NOT NULL,
 CONSTRAINT [PK_BorrowLoan_Repay] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_Repay]') AND name = N'IX_BorrowLoan_Repay')
CREATE NONCLUSTERED INDEX [IX_BorrowLoan_Repay] ON [dbo].[BorrowLoan_Repay] 
(
	[BorrowId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[BorrowLoan_Receive]    Script Date: 01/20/2016 18:36:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_Receive]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[BorrowLoan_Receive](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[UserId] [bigint] NOT NULL,
	[UserName] [nvarchar](50) NOT NULL,
	[Nickname] [nvarchar](50) NOT NULL,
	[BorrowId] [bigint] NOT NULL,
	[BorrowName] [nvarchar](100) NOT NULL,
	[BorrowTypeId] [bigint] NOT NULL,
	[TransferId] [bigint] NULL,
	[TransferName] [nvarchar](100) NOT NULL,
	[BidId] [bigint] NOT NULL,
	[Period] [int] NOT NULL,
	[PeriodStartAt] [datetime] NOT NULL,
	[PeriodEndAt] [datetime] NOT NULL,
	[ShouldRepayAt] [datetime] NOT NULL,
	[ActualRepayAt] [datetime] NULL,
	[ShouldRepayPrincipal] [decimal](18, 3) NOT NULL,
	[ShouldRepayPrincipalRed] [decimal](18, 3) NOT NULL,
	[ActuaRepayPrincipal] [decimal](18, 3) NOT NULL,
	[ShouldRepayInterest] [decimal](18, 3) NOT NULL,
	[ActuaRepayInterest] [decimal](18, 3) NOT NULL,
	[ShouldRepayOverdue] [decimal](18, 3) NOT NULL,
	[ActuaRepayOverdue] [decimal](18, 3) NOT NULL,
	[AdvanceRepayViolate] [decimal](18, 3) NOT NULL,
	[ShouldRepayFee] [decimal](18, 3) NOT NULL,
	[InterestManageFee] [decimal](18, 3) NOT NULL,
	[Settle] [bit] NOT NULL,
	[ActuaRepayUserId] [bigint] NULL,
	[ActuaRepayUserName] [nvarchar](100) NOT NULL,
	[CreateAt] [datetime] NOT NULL,
 CONSTRAINT [PK_BorrowLoan_Receive] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_Receive]') AND name = N'IX_BorrowLoan_Receive')
CREATE NONCLUSTERED INDEX [IX_BorrowLoan_Receive] ON [dbo].[BorrowLoan_Receive] 
(
	[BorrowId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[BorrowLoan_PromotionLog]    Script Date: 01/20/2016 18:36:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_PromotionLog]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[BorrowLoan_PromotionLog](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[ListId] [bigint] NOT NULL,
	[ListName] [nvarchar](100) NOT NULL,
	[UserId] [bigint] NOT NULL,
	[UserName] [nvarchar](50) NOT NULL,
	[Nickname] [nvarchar](50) NOT NULL,
	[RewardMoney] [decimal](18, 2) NOT NULL,
	[RewardMoneyUsed] [decimal](18, 2) NOT NULL,
	[Expires] [datetime] NULL,
	[RewardDescription] [nvarchar](max) NOT NULL,
	[CreateAt] [datetime] NOT NULL,
 CONSTRAINT [PK_Promotion_Log] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[BorrowLoan_Promotion]    Script Date: 01/20/2016 18:36:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_Promotion]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[BorrowLoan_Promotion](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](100) NOT NULL,
	[Limit] [int] NULL,
	[LimitPeriod] [int] NOT NULL,
	[Active] [bit] NOT NULL,
	[StartAt] [datetime] NOT NULL,
	[EndAt] [datetime] NULL,
	[Cover] [nvarchar](100) NOT NULL,
	[Description] [nvarchar](max) NOT NULL,
	[Url] [nvarchar](100) NOT NULL,
	[Detail] [nvarchar](max) NOT NULL,
	[RewardTpe] [int] NOT NULL,
	[RewardValue] [nvarchar](max) NOT NULL,
	[RewardExpires] [int] NULL,
	[UserFilterInterfaceJson] [nvarchar](max) NULL,
	[IsDisplay] [bit] NOT NULL,
	[OrderBy] [int] NOT NULL,
 CONSTRAINT [PK_Promotion_List] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[BorrowLoan_OverdueList]    Script Date: 01/20/2016 18:36:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_OverdueList]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[BorrowLoan_OverdueList](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[UserId] [bigint] NOT NULL,
	[UserName] [nvarchar](50) NOT NULL,
	[RealName] [nvarchar](50) NOT NULL,
	[CardNumber] [nvarchar](50) NOT NULL,
	[BorrowName] [nvarchar](100) NOT NULL,
	[OverdueAmount] [decimal](18, 3) NOT NULL,
	[RepayId] [bigint] NOT NULL,
	[Settle] [bit] NOT NULL,
	[OverdueDay] [int] NOT NULL,
	[ModifyAt] [datetime] NOT NULL,
	[CreateAt] [datetime] NOT NULL,
 CONSTRAINT [PK_BorrowLoan_OverdueList] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_OverdueList]') AND name = N'IX_BorrowLoan_OverdueList')
CREATE NONCLUSTERED INDEX [IX_BorrowLoan_OverdueList] ON [dbo].[BorrowLoan_OverdueList] 
(
	[UserId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_OverdueList]') AND name = N'IX_BorrowLoan_OverdueList_1')
CREATE NONCLUSTERED INDEX [IX_BorrowLoan_OverdueList_1] ON [dbo].[BorrowLoan_OverdueList] 
(
	[RepayId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[BorrowLoan_OfflineApply]    Script Date: 01/20/2016 18:36:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_OfflineApply]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[BorrowLoan_OfflineApply](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[UserId] [bigint] NULL,
	[Name] [nvarchar](50) NOT NULL,
	[Phone] [nvarchar](100) NOT NULL,
	[Status] [nvarchar](50) NOT NULL,
	[Remark] [nvarchar](max) NOT NULL,
	[InfoJson] [nvarchar](max) NULL,
	[CreateAt] [datetime] NOT NULL,
	[AdminById] [bigint] NULL,
	[TrackLogJson] [nvarchar](max) NULL,
 CONSTRAINT [PK_BorrowLoan_OfflineApply] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_OfflineApply]') AND name = N'IX_BorrowLoan_OfflineApply')
CREATE NONCLUSTERED INDEX [IX_BorrowLoan_OfflineApply] ON [dbo].[BorrowLoan_OfflineApply] 
(
	[UserId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[BorrowLoan_Borrow]    Script Date: 01/20/2016 18:36:13 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_Borrow]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[BorrowLoan_Borrow](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[BusId] [nvarchar](30) NOT NULL,
	[TypeId] [bigint] NOT NULL,
	[UserId] [bigint] NOT NULL,
	[UserName] [nvarchar](50) NOT NULL,
	[Nickname] [nvarchar](50) NOT NULL,
	[AgentAdminId] [bigint] NULL,
	[AgentAdminName] [nvarchar](50) NOT NULL,
	[Name] [nvarchar](100) NOT NULL,
	[Color] [nvarchar](20) NOT NULL,
	[UseTo] [nvarchar](max) NOT NULL,
	[RepaySrc] [nvarchar](max) NOT NULL,
	[VouchCompanyId] [bigint] NULL,
	[VouchCompanyName] [nvarchar](50) NOT NULL,
	[Status] [int] NOT NULL,
	[Cover] [nvarchar](100) NOT NULL,
	[Hits] [bigint] NOT NULL,
	[LoanAmount] [decimal](18, 3) NOT NULL,
	[LoanInterestJson] [nvarchar](max) NOT NULL,
	[InterestStartType] [int] NOT NULL,
	[BidPushAccount] [bit] NOT NULL,
	[YearRate] [decimal](18, 8) NOT NULL,
	[LoanDateUnit] [int] NOT NULL,
	[LoanDate] [int] NOT NULL,
	[InterestType] [int] NOT NULL,
	[ShouldInterestManage] [decimal](18, 3) NOT NULL,
	[ActuaInterestManage] [decimal](18, 3) NOT NULL,
	[BidRewardType] [int] NOT NULL,
	[BidRewardAmount] [decimal](18, 3) NULL,
	[BidRewardRatio] [decimal](18, 8) NULL,
	[Repayment] [nvarchar](50) NOT NULL,
	[FeeRate] [decimal](18, 8) NOT NULL,
	[StepAmount] [decimal](18, 3) NOT NULL,
	[ByStep] [bit] NOT NULL,
	[BidMaxAmount] [decimal](18, 3) NULL,
	[BidMinAmount] [decimal](18, 3) NOT NULL,
	[BidEndAt] [datetime] NULL,
	[OpenMyAccount] [bit] NOT NULL,
	[OpenMyBorrow] [bit] NOT NULL,
	[OpenMyBid] [bit] NOT NULL,
	[OpenMyQuota] [bit] NOT NULL,
	[OpenMyBorrowInfo] [bit] NOT NULL,
	[OpenMyInfo] [bit] NOT NULL,
	[RepayInterestCount] [decimal](18, 3) NOT NULL,
	[Bond] [decimal](18, 3) NOT NULL,
	[RepayPrincipalCount] [decimal](18, 3) NOT NULL,
	[BidAt] [datetime] NULL,
	[OrderBy] [int] NOT NULL,
	[PublishVerifyAdminId] [bigint] NULL,
	[PublishVerifyAdminName] [nvarchar](50) NOT NULL,
	[PublishVerifyAt] [datetime] NULL,
	[PublishVerifyRemark] [nvarchar](max) NOT NULL,
	[FullVerifyRemark] [nvarchar](max) NOT NULL,
	[FullVerifyAdminId] [bigint] NULL,
	[FullVerifyAdminName] [nvarchar](50) NOT NULL,
	[FullVerifyAt] [datetime] NULL,
	[EndAt] [datetime] NULL,
	[ProvinceId] [bigint] NOT NULL,
	[CityId] [bigint] NOT NULL,
	[AreaId] [bigint] NOT NULL,
	[CreateAt] [datetime] NOT NULL,
	[CanAutoBid] [bit] NOT NULL,
	[AutoBidAmount] [decimal](18, 3) NULL,
	[PasswordCode] [nvarchar](50) NOT NULL,
	[WebSafeType] [int] NOT NULL,
	[OverdueInDay] [int] NOT NULL,
	[OverdueOutRate] [decimal](18, 8) NOT NULL,
	[OverdueInRate] [decimal](18, 8) NOT NULL,
	[BidAmountCount] [decimal](18, 3) NOT NULL,
	[BidUserCount] [int] NOT NULL,
	[HomeDisplay] [bit] NOT NULL,
	[ReserveId] [bigint] NULL,
	[ReserveBidEndAt] [datetime] NULL,
	[MarginRatio] [decimal](18, 8) NOT NULL,
	[MortgageId] [bigint] NULL,
	[MortgageName] [nvarchar](100) NOT NULL,
	[LoanFee] [decimal](18, 8) NOT NULL,
	[NeedInterestFee] [bit] NOT NULL,
	[UserFilterInterfaceJson] [nvarchar](max) NULL,
	[RefillCastRate] [decimal](18, 8) NOT NULL,
	[UserSnapJson] [nvarchar](max) NULL,
	[BidFullAutoRepay] [bit] NOT NULL,
	[Detail] [nvarchar](max) NOT NULL,
	[AdvanceRepay] [int] NOT NULL,
	[AdvanceRepayOutDay] [int] NOT NULL,
	[AdvanceRepayOutRate] [decimal](18, 8) NOT NULL,
	[UseRedPackage] [bit] NOT NULL,
	[Timestamp] [timestamp] NOT NULL,
 CONSTRAINT [PK_BorrowLoan_Borrow] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_Borrow]') AND name = N'IX_BorrowLoan_Borrow')
CREATE NONCLUSTERED INDEX [IX_BorrowLoan_Borrow] ON [dbo].[BorrowLoan_Borrow] 
(
	[UserId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_Borrow]') AND name = N'IX_BorrowLoan_Borrow_1')
CREATE NONCLUSTERED INDEX [IX_BorrowLoan_Borrow_1] ON [dbo].[BorrowLoan_Borrow] 
(
	[Status] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[BorrowLoan_Bid]    Script Date: 01/20/2016 18:36:13 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_Bid]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[BorrowLoan_Bid](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[UserId] [bigint] NOT NULL,
	[UserName] [nvarchar](50) NOT NULL,
	[Nickname] [nvarchar](50) NOT NULL,
	[BorrowId] [bigint] NOT NULL,
	[BorrowName] [nvarchar](100) NOT NULL,
	[BorrowTypeId] [bigint] NOT NULL,
	[Amount] [decimal](18, 3) NOT NULL,
	[AutoBidId] [bigint] NULL,
	[AutoBidIndex] [bigint] NULL,
	[TempHoldId] [bigint] NOT NULL,
	[CreateAt] [datetime] NOT NULL,
	[Settle] [bit] NOT NULL,
	[RewardMoney] [decimal](18, 3) NOT NULL,
	[RewardUseJson] [nvarchar](max) NOT NULL,
 CONSTRAINT [PK_BorrowLoan_Bid] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_Bid]') AND name = N'IX_BorrowLoan_Bid')
CREATE NONCLUSTERED INDEX [IX_BorrowLoan_Bid] ON [dbo].[BorrowLoan_Bid] 
(
	[UserId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_Bid]') AND name = N'IX_BorrowLoan_Bid_1')
CREATE NONCLUSTERED INDEX [IX_BorrowLoan_Bid_1] ON [dbo].[BorrowLoan_Bid] 
(
	[BorrowId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[BorrowLoan_AutoRepay]    Script Date: 01/20/2016 18:36:13 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_AutoRepay]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[BorrowLoan_AutoRepay](
	[Id] [bigint] NOT NULL,
	[UserName] [nvarchar](50) NOT NULL,
	[Expires] [datetime] NULL,
	[AuthCode] [nvarchar](100) NOT NULL,
	[CreateAt] [datetime] NOT NULL,
	[LastSuccess] [datetime] NULL,
 CONSTRAINT [PK_BorrowLoan_AutoRepay] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[BorrowLoan_AutoBid]    Script Date: 01/20/2016 18:36:13 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_AutoBid]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[BorrowLoan_AutoBid](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[UserId] [bigint] NOT NULL,
	[UserName] [nvarchar](50) NOT NULL,
	[Name] [nvarchar](50) NOT NULL,
	[Active] [bit] NOT NULL,
	[RelatedFilter] [int] NULL,
	[CreditLevelId] [bigint] NULL,
	[ValidDateMin] [int] NULL,
	[ValidDateMax] [int] NULL,
	[ValidInterestMin] [decimal](18, 8) NULL,
	[ValidInterestMax] [decimal](18, 8) NULL,
	[ValidAmountMin] [decimal](18, 3) NULL,
	[ValidAmountMax] [decimal](18, 3) NULL,
	[BidAmountMin] [decimal](18, 3) NULL,
	[BidAmountMax] [decimal](18, 3) NULL,
	[BidQueue] [bigint] NOT NULL,
	[BorrowTypeId] [bigint] NULL,
	[LastSuccessBid] [datetime] NULL,
	[BidTransfer] [bit] NOT NULL,
	[AutoBidTypeId] [bigint] NULL,
	[Repayment] [nvarchar](50) NOT NULL,
	[OneBidRate] [decimal](18, 8) NOT NULL,
	[EstimatedAmount] [decimal](18, 3) NULL,
	[BidedAmount] [decimal](18, 3) NOT NULL,
	[CreateAt] [datetime] NOT NULL,
 CONSTRAINT [PK_BorrowLoan_AutoBid] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_AutoBid]') AND name = N'IX_BorrowLoan_AutoBid')
CREATE NONCLUSTERED INDEX [IX_BorrowLoan_AutoBid] ON [dbo].[BorrowLoan_AutoBid] 
(
	[BidQueue] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[BorrowLoan_AutoBid]') AND name = N'IX_BorrowLoan_AutoBid_1')
CREATE NONCLUSTERED INDEX [IX_BorrowLoan_AutoBid_1] ON [dbo].[BorrowLoan_AutoBid] 
(
	[UserId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[BBS_Topic]    Script Date: 01/20/2016 18:36:13 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BBS_Topic]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[BBS_Topic](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[CategoryId] [bigint] NOT NULL,
	[UserId] [bigint] NOT NULL,
	[UserName] [nvarchar](50) NOT NULL,
	[Nickname] [nvarchar](50) NOT NULL,
	[Title] [nvarchar](200) NOT NULL,
	[Color] [nvarchar](7) NOT NULL,
	[Detail] [nvarchar](max) NOT NULL,
	[SlideImg] [nvarchar](max) NOT NULL,
	[Hits] [int] NOT NULL,
	[IP] [nvarchar](15) NOT NULL,
	[FixedTop] [bit] NOT NULL,
	[ReplyCount] [int] NOT NULL,
	[CreateAt] [datetime] NOT NULL,
	[ModifyAt] [datetime] NOT NULL,
 CONSTRAINT [PK_BBS_Topic] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[BBS_Topic]') AND name = N'IX_BBS_Topic')
CREATE NONCLUSTERED INDEX [IX_BBS_Topic] ON [dbo].[BBS_Topic] 
(
	[CategoryId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[BBS_Reply]    Script Date: 01/20/2016 18:36:13 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BBS_Reply]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[BBS_Reply](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[TopicId] [bigint] NOT NULL,
	[Detail] [nvarchar](max) NOT NULL,
	[UserId] [bigint] NOT NULL,
	[UserName] [nvarchar](50) NOT NULL,
	[Nickname] [nvarchar](50) NOT NULL,
	[CreateAt] [datetime] NOT NULL,
	[IP] [nvarchar](15) NOT NULL,
 CONSTRAINT [PK_BBS_Reply] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[BBS_Reply]') AND name = N'IX_BBS_Reply')
CREATE NONCLUSTERED INDEX [IX_BBS_Reply] ON [dbo].[BBS_Reply] 
(
	[TopicId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[BBS_Category]    Script Date: 01/20/2016 18:36:13 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BBS_Category]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[BBS_Category](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](50) NOT NULL,
	[Description] [nvarchar](max) NOT NULL,
	[OrderBy] [int] NOT NULL,
	[TopicCount] [int] NOT NULL,
	[Icon] [nvarchar](100) NOT NULL,
 CONSTRAINT [PK_BBS_Category] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[Article_HelpCategory]    Script Date: 01/20/2016 18:36:13 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Article_HelpCategory]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Article_HelpCategory](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](50) NOT NULL,
	[ParentId] [bigint] NOT NULL,
	[Active] [bit] NOT NULL,
	[Icon] [nvarchar](100) NOT NULL,
	[OrderBy] [int] NOT NULL,
 CONSTRAINT [PK_Article_HelpCategory] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[Article_HelpArticle]    Script Date: 01/20/2016 18:36:14 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Article_HelpArticle]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Article_HelpArticle](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[CategoryId] [bigint] NOT NULL,
	[Title] [nvarchar](100) NOT NULL,
	[SelfPage] [bit] NOT NULL,
	[Detail] [nvarchar](max) NOT NULL,
	[Active] [bit] NOT NULL,
	[OrderBy] [int] NOT NULL,
 CONSTRAINT [PK_Article_HelpArticle] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Article_HelpArticle]') AND name = N'IX_Article_HelpArticle')
CREATE NONCLUSTERED INDEX [IX_Article_HelpArticle] ON [dbo].[Article_HelpArticle] 
(
	[CategoryId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Article_Category]    Script Date: 01/20/2016 18:36:14 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Article_Category]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Article_Category](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](50) NOT NULL,
	[ParentId] [bigint] NOT NULL,
	[IsArticle] [bit] NOT NULL,
	[Detail] [nvarchar](max) NOT NULL,
	[Active] [bit] NOT NULL,
	[Url] [nvarchar](500) NOT NULL,
	[CreateAt] [datetime] NOT NULL,
	[ModifyAt] [datetime] NOT NULL,
	[ModifyBy] [nvarchar](50) NOT NULL,
	[OrderBy] [int] NOT NULL,
 CONSTRAINT [PK_Article_Category] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[Article_Article]    Script Date: 01/20/2016 18:36:14 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Article_Article]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Article_Article](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[CategoryId] [bigint] NOT NULL,
	[Title] [nvarchar](100) NOT NULL,
	[Author] [nvarchar](50) NOT NULL,
	[Cover] [nvarchar](100) NOT NULL,
	[Description] [nvarchar](max) NOT NULL,
	[Detail] [nvarchar](max) NOT NULL,
	[Active] [bit] NOT NULL,
	[Url] [nvarchar](500) NOT NULL,
	[Hits] [bigint] NOT NULL,
	[CreateAt] [datetime] NOT NULL,
	[ModifyAt] [datetime] NOT NULL,
	[ModifyBy] [nvarchar](50) NOT NULL,
	[OrderBy] [int] NOT NULL,
	[PcShow] [bit] NOT NULL,
	[MobileShow] [bit] NOT NULL,
 CONSTRAINT [PK_Article_Article] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Article_Article]') AND name = N'IX_Article_Article')
CREATE NONCLUSTERED INDEX [IX_Article_Article] ON [dbo].[Article_Article] 
(
	[CategoryId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Account_UserAccountLog]    Script Date: 01/20/2016 18:36:14 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Account_UserAccountLog]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Account_UserAccountLog](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[UserId] [bigint] NOT NULL,
	[UserName] [nvarchar](50) NOT NULL,
	[TargetUserName] [nvarchar](50) NOT NULL,
	[Type] [int] NOT NULL,
	[TypeData] [nvarchar](50) NOT NULL,
	[Money] [decimal](18, 3) NOT NULL,
	[OnlineAccount] [decimal](18, 3) NOT NULL,
	[OfflineAccount] [decimal](18, 3) NOT NULL,
	[ReceiveAccount] [decimal](18, 3) NOT NULL,
	[LoanAccount] [decimal](18, 3) NOT NULL,
	[RewardAccount] [decimal](18, 3) NOT NULL,
	[OnlineAccountHold] [decimal](18, 3) NOT NULL,
	[OfflineAccountHold] [decimal](18, 3) NOT NULL,
	[ReceiveAccountHold] [decimal](18, 3) NOT NULL,
	[LoanAccountHold] [decimal](18, 3) NOT NULL,
	[RewardAccountHold] [decimal](18, 3) NOT NULL,
	[OnlineAccountLock] [decimal](18, 3) NOT NULL,
	[OfflineAccountLock] [decimal](18, 3) NOT NULL,
	[ReceiveAccountLock] [decimal](18, 3) NOT NULL,
	[LoanAccountLock] [decimal](18, 3) NOT NULL,
	[RewardAccountLock] [decimal](18, 3) NOT NULL,
	[WaitReceive] [decimal](18, 3) NOT NULL,
	[WaitRepayment] [decimal](18, 3) NOT NULL,
	[Remark] [nvarchar](max) NOT NULL,
	[CreateAt] [datetime] NOT NULL,
 CONSTRAINT [PK_Account_UserAccountLog] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Account_UserAccountLog]') AND name = N'IX_Account_UserAccountLog')
CREATE NONCLUSTERED INDEX [IX_Account_UserAccountLog] ON [dbo].[Account_UserAccountLog] 
(
	[UserId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Account_UserAccount]    Script Date: 01/20/2016 18:36:15 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Account_UserAccount]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Account_UserAccount](
	[Id] [bigint] NOT NULL,
	[OnlineAccount] [decimal](18, 3) NOT NULL,
	[OfflineAccount] [decimal](18, 3) NOT NULL,
	[ReceiveAccount] [decimal](18, 3) NOT NULL,
	[LoanAccount] [decimal](18, 3) NOT NULL,
	[RewardAccount] [decimal](18, 3) NOT NULL,
	[OnlineAccountHold] [decimal](18, 3) NOT NULL,
	[OfflineAccountHold] [decimal](18, 3) NOT NULL,
	[ReceiveAccountHold] [decimal](18, 3) NOT NULL,
	[LoanAccountHold] [decimal](18, 3) NOT NULL,
	[RewardAccountHold] [decimal](18, 3) NOT NULL,
	[OnlineAccountLock] [decimal](18, 3) NOT NULL,
	[OfflineAccountLock] [decimal](18, 3) NOT NULL,
	[ReceiveAccountLock] [decimal](18, 3) NOT NULL,
	[LoanAccountLock] [decimal](18, 3) NOT NULL,
	[RewardAccountLock] [decimal](18, 3) NOT NULL,
	[WaitReceive] [decimal](18, 3) NOT NULL,
	[WaitRepayment] [decimal](18, 3) NOT NULL,
	[Timestamp] [timestamp] NOT NULL,
 CONSTRAINT [PK_Account_UserAccount] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[Account_TempHold]    Script Date: 01/20/2016 18:36:15 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Account_TempHold]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Account_TempHold](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[Online] [decimal](18, 3) NOT NULL,
	[Offline] [decimal](18, 3) NOT NULL,
	[Receive] [decimal](18, 3) NOT NULL,
	[Loan] [decimal](18, 3) NOT NULL,
	[Reward] [decimal](18, 3) NOT NULL,
 CONSTRAINT [PK_Account_TempHold] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[Account_Recharge]    Script Date: 01/20/2016 18:36:15 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Account_Recharge]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Account_Recharge](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[UserId] [bigint] NOT NULL,
	[UserName] [nvarchar](50) NOT NULL,
	[Status] [int] NOT NULL,
	[UserRemark] [nvarchar](max) NOT NULL,
	[Type] [int] NOT NULL,
	[Amount] [decimal](18, 3) NOT NULL,
	[Fee] [decimal](18, 3) NOT NULL,
	[OrderNo] [nvarchar](100) NOT NULL,
	[PayAccount] [nvarchar](100) NOT NULL,
	[PayPlatformName] [nvarchar](100) NOT NULL,
	[RecordedInfo] [nvarchar](50) NOT NULL,
	[VerifyAdminId] [bigint] NULL,
	[VerifyAdminName] [nvarchar](50) NOT NULL,
	[VerifyAt] [datetime] NULL,
	[CreateAt] [datetime] NOT NULL,
	[Timestamp] [timestamp] NOT NULL,
 CONSTRAINT [PK_Account_Recharge] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY],
 CONSTRAINT [IX_Account_Recharge_2] UNIQUE NONCLUSTERED 
(
	[OrderNo] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Account_Recharge]') AND name = N'IX_Account_Recharge')
CREATE NONCLUSTERED INDEX [IX_Account_Recharge] ON [dbo].[Account_Recharge] 
(
	[OrderNo] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Account_Recharge]') AND name = N'IX_Account_Recharge_1')
CREATE NONCLUSTERED INDEX [IX_Account_Recharge_1] ON [dbo].[Account_Recharge] 
(
	[UserId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Account_ReceiveRepayLog]    Script Date: 01/20/2016 18:36:15 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Account_ReceiveRepayLog]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Account_ReceiveRepayLog](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[UserId] [bigint] NOT NULL,
	[UserName] [nvarchar](50) NOT NULL,
	[Repayment] [decimal](18, 3) NOT NULL,
	[Receive] [decimal](18, 3) NOT NULL,
	[Sum] [decimal](18, 3) NOT NULL,
	[AvaliableSum] [decimal](18, 3) NOT NULL,
	[WaitRepayment] [decimal](18, 3) NOT NULL,
	[WaitReceive] [decimal](18, 3) NOT NULL,
	[Remark] [nvarchar](max) NOT NULL,
	[CreateAt] [datetime] NOT NULL,
 CONSTRAINT [PK_Account_ReceiveRepayLog] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Account_ReceiveRepayLog]') AND name = N'IX_Account_ReceiveRepayLog')
CREATE NONCLUSTERED INDEX [IX_Account_ReceiveRepayLog] ON [dbo].[Account_ReceiveRepayLog] 
(
	[UserId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Account_CashApply]    Script Date: 01/20/2016 18:36:15 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Account_CashApply]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Account_CashApply](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[UserId] [bigint] NOT NULL,
	[UserName] [nvarchar](50) NOT NULL,
	[BankCardId] [bigint] NOT NULL,
	[BankName] [nvarchar](50) NOT NULL,
	[CardNo] [nvarchar](50) NOT NULL,
	[AccountName] [nvarchar](50) NOT NULL,
	[Fee] [decimal](18, 3) NOT NULL,
	[Status] [int] NOT NULL,
	[Amount] [decimal](18, 3) NOT NULL,
	[TempHoldId] [bigint] NOT NULL,
	[UserRemark] [nvarchar](max) NOT NULL,
	[CreateAt] [datetime] NOT NULL,
	[VerifyAdminId] [bigint] NULL,
	[VerifyAdminName] [nvarchar](50) NOT NULL,
	[VerifyAt] [datetime] NULL,
	[VerifyRemark] [nvarchar](max) NOT NULL,
	[PayAdminId] [bigint] NULL,
	[PayAdminName] [nvarchar](50) NOT NULL,
	[PayAt] [datetime] NULL,
	[ExchangeNo] [nvarchar](50) NOT NULL,
	[PaySuccessAt] [datetime] NULL,
	[ExtractionCashTime] [int] NULL,
	[Timestamp] [timestamp] NOT NULL,
 CONSTRAINT [PK_Account_CashApply] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[Account_BankCard]    Script Date: 01/20/2016 18:36:15 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Account_BankCard]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Account_BankCard](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[UserId] [bigint] NOT NULL,
	[BankName] [nvarchar](50) NOT NULL,
	[CardNo] [nvarchar](50) NOT NULL,
	[AccountName] [nvarchar](50) NOT NULL,
	[ProvinceId] [bigint] NULL,
	[CityId] [bigint] NULL,
	[AreaId] [bigint] NULL,
	[Branch] [nvarchar](50) NOT NULL,
	[ValidBy] [nvarchar](50) NOT NULL,
	[ValidAt] [datetime] NULL,
	[ValidRemark] [nvarchar](max) NOT NULL,
	[CreateAt] [datetime] NOT NULL,
	[Status] [int] NOT NULL,
	[LastUseAt] [datetime] NULL,
 CONSTRAINT [PK_Member_BankCard] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Account_BankCard]') AND name = N'IX_Account_BankCard')
CREATE NONCLUSTERED INDEX [IX_Account_BankCard] ON [dbo].[Account_BankCard] 
(
	[UserId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
