SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE TABLE [dbo].[Behaviors](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[ReferenceType] [int] NOT NULL,
	[ReferenceId] [int] NOT NULL,
	[UserId] [int] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[LastModifyTime] [datetime] NOT NULL,
	[Type] [int] NOT NULL,
 CONSTRAINT [PK_Behaviors] 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]
ALTER TABLE [dbo].[Behaviors] ADD  CONSTRAINT [DF_Behaviors_CreateTime]  DEFAULT (getdate()) FOR [CreateTime]
ALTER TABLE [dbo].[Behaviors] ADD  CONSTRAINT [DF_Behaviors_LastModifyTime]  DEFAULT (getdate()) FOR [LastModifyTime]

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE TABLE [dbo].[Favorites](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[ReferenceType] [int] NOT NULL,
	[ReferenceId] [int] NOT NULL,
	[UserId] [int] NOT NULL,
	[CreateTime] [datetime] NOT NULL CONSTRAINT [DF_Favorites_CreateTime]  DEFAULT (getdate()),
	[LastModifyTime] [datetime] NOT NULL CONSTRAINT [DF_Favorites_LastModityTime]  DEFAULT (getdate()),
	[ReferenceIsDelete] [bit] NOT NULL CONSTRAINT [DF_Favorites_IsDelete]  DEFAULT ((0)),
 CONSTRAINT [PK_Favorites] 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]

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE TABLE [dbo].[Messages](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Title] [nvarchar](50) NULL,
	[MContent] [nvarchar](max) NULL,
	[CreateTime] [datetime] NOT NULL CONSTRAINT [DF_Messages_CreateTime]  DEFAULT (getdate()),
	[LastModifyTime] [datetime] NOT NULL CONSTRAINT [DF_Messages_LastModifyTime]  DEFAULT (getdate()),
	[UserId] [int] NOT NULL,
	[IsDelete] [bit] NOT NULL CONSTRAINT [DF_Messages_IsDelete]  DEFAULT ((0)),
	[Type] [int] NOT NULL,
 CONSTRAINT [PK_Messages] 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]

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE TABLE [dbo].[MessageUsers](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[MessageId] [int] NOT NULL,
	[UserId] [int] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
 CONSTRAINT [PK_MessageUsers] 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]
ALTER TABLE [dbo].[MessageUsers] ADD  CONSTRAINT [DF_MessageUsers_CreateTime]  DEFAULT (getdate()) FOR [CreateTime]

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE TABLE [dbo].[UserMessages](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[MessageId] [int] NOT NULL,
	[UserId] [int] NOT NULL,
	[IsRead] [bit] NOT NULL CONSTRAINT [DF_UserMessages_IsRead]  DEFAULT ((0)),
	[IsDelete] [bit] NOT NULL CONSTRAINT [DF_UserMessages_IsDelete]  DEFAULT ((0)),
	[CreateTime] [datetime] NOT NULL CONSTRAINT [DF_UserMessages_CreateTime]  DEFAULT (getdate()),
	[LastModifyTime] [datetime] NOT NULL CONSTRAINT [DF_UserMessages_LastModifyTime]  DEFAULT (getdate()),
 CONSTRAINT [PK_UserMessages] 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]

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE TABLE [dbo].[UserTokens](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[UserId] [int] NOT NULL,
	[Token] [nvarchar](50) NOT NULL,
	[CreateTime] [datetime] NOT NULL CONSTRAINT [DF_UserTokens_CreateTime]  DEFAULT (getdate()),
	[LastModifyTime] [datetime] NOT NULL CONSTRAINT [DF_UserTokens_LastModifyTime]  DEFAULT (getdate()),
	[ExpirationTime] [datetime] NOT NULL,
 CONSTRAINT [PK_UserTokens] 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]

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE TABLE [dbo].[Logs](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Type] [int] NOT NULL,
	[Url] [nvarchar](max) NULL,
	[Message] [nvarchar](max) NULL,
	[CreateTime] [datetime] NOT NULL,
 CONSTRAINT [PK_Logs] 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]
ALTER TABLE [dbo].[Logs] ADD  CONSTRAINT [DF_Logs_CreateTime]  DEFAULT (getdate()) FOR [CreateTime]

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE TABLE [dbo].[Articles](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Title] [nvarchar](200) NOT NULL,
	[Description] [nvarchar](max) NULL,
	[UserId] [int] NOT NULL,
	[AContent] [nvarchar](max) NOT NULL,
	[CategoryId] [int] NOT NULL,
	[IsTop] [bit] NOT NULL CONSTRAINT [DF_Articles_IsTop]  DEFAULT ((0)),
	[ReadQuantity] [int] NOT NULL CONSTRAINT [DF_Articles_ReadCount]  DEFAULT ((1)),
	[Tags] [nvarchar](max) NULL,
	[CoverImg] [nvarchar](max) NULL,
	[CommentQuantity] [int] NOT NULL CONSTRAINT [DF_Articles_CommentCount]  DEFAULT ((0)),
	[CreateTime] [datetime] NOT NULL CONSTRAINT [DF_Articles_CreateTime]  DEFAULT (getdate()),
	[LastModifyTime] [datetime] NOT NULL CONSTRAINT [DF_Articles_LastModifyTime]  DEFAULT (getdate()),
	[Sort] [int] NOT NULL CONSTRAINT [DF_Articles_Sort]  DEFAULT ((50)),
	[IsDelete] [bit] NOT NULL CONSTRAINT [DF_Articles_IsDelete]  DEFAULT ((0)),
	[Status] [int] NOT NULL CONSTRAINT [DF_Articles_Status]  DEFAULT ((1)),
	[StatusMessage] [nvarchar](max) NULL,
 CONSTRAINT [PK_Articles] 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]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[ArticleStats](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Date] [datetime] NOT NULL,
	[Type] [int] NOT NULL,
	[Quantity] [int] NOT NULL,
 CONSTRAINT [PK_ArticleStats] 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]


SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[Categories](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](50) NOT NULL,
	[Tags] [nvarchar](200) NULL,
	[Description] [nvarchar](2000) NULL,
	[IsDelete] [bit] NOT NULL CONSTRAINT [DF_Categories_IsDelete]  DEFAULT ((0)),
 CONSTRAINT [PK_Categories] 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]

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE TABLE [dbo].[FriendLinks](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Text] [nvarchar](50) NOT NULL,
	[Description] [nvarchar](2000) NULL,
	[Target] [int] NOT NULL,
	[Url] [nvarchar](max) NOT NULL,
	[IsValid] [bit] NOT NULL CONSTRAINT [DF_FriendLinks_IsValid]  DEFAULT ((1)),
	[CreateTime] [datetime] NOT NULL CONSTRAINT [DF_FriendLinks_CreateTime]  DEFAULT (getdate()),
	[LastModifyTime] [datetime] NOT NULL CONSTRAINT [DF_FriendLinks_LastModifyTime]  DEFAULT (getdate()),
	[Sort] [int] NOT NULL CONSTRAINT [DF_FriendLinks_Sort]  DEFAULT ((50)),
 CONSTRAINT [PK_FriendLinks] 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]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[Comments](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[ArticleId] [int] NOT NULL,
	[Nickname] [nvarchar](100) NULL,
	[CContent] [nvarchar](max) NOT NULL,
	[TargetCommentId] [int] NOT NULL,
	[Status] [int] NOT NULL,
	[CreateTime] [datetime] NOT NULL CONSTRAINT [DF_Comments_CreateTime]  DEFAULT (getdate()),
	[Ip] [nvarchar](50) NULL,
	[UserId] [int] NULL,
	[LastModifyTime] [datetime] NOT NULL CONSTRAINT [DF_Comments_LastModifyTime]  DEFAULT (getdate()),
	[IsDelete] [bit] NOT NULL CONSTRAINT [DF_Comments_IsDelete]  DEFAULT ((0)),
 CONSTRAINT [PK_Comments] 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]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[FlashImages](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Description] [nvarchar](200) NOT NULL,
	[ImageUrl] [nvarchar](max) NOT NULL,
	[Link] [nvarchar](max) NULL,
	[CreateTime] [datetime] NOT NULL CONSTRAINT [DF_FlashImages_CreateTime]  DEFAULT (getdate()),
	[LastModifyTime] [datetime] NOT NULL CONSTRAINT [DF_FlashImages_LastModifyTime]  DEFAULT (getdate()),
	[IsValid] [bit] NOT NULL CONSTRAINT [DF_FlashImages_IsValid]  DEFAULT ((1)),
	[Sort] [int] NOT NULL CONSTRAINT [DF_FlashImages_Sort]  DEFAULT ((50)),
	[Target] [int] NULL,
 CONSTRAINT [PK_FlashImages] 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]


SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[Menus](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](50) NOT NULL,
	[ParentId] [int] NULL,
	[CreateTime] [datetime] NOT NULL CONSTRAINT [DF_Menus_CreateTime]  DEFAULT (getdate()),
	[LastModifyTime] [datetime] NOT NULL CONSTRAINT [DF_Menus_LastModifyTime]  DEFAULT (getdate()),
	[PermissionId] [int] NULL,
	[Icon] [nvarchar](100) NULL,
	[Url] [nvarchar](max) NULL,
	[Sort] [int] NOT NULL CONSTRAINT [DF_Menus_Sort]  DEFAULT ((50)),
 CONSTRAINT [PK_Menus] 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]


SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[Navs](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Text] [nvarchar](100) NOT NULL,
	[Target] [int] NOT NULL,
	[Url] [nvarchar](max) NOT NULL,
	[IsValid] [bit] NOT NULL CONSTRAINT [DF_Table_1_Valid]  DEFAULT ((1)),
	[CreateTime] [datetime] NOT NULL CONSTRAINT [DF_Navs_CreateTime]  DEFAULT (getdate()),
	[LastModifyTime] [datetime] NOT NULL CONSTRAINT [DF_Navs_LastModifyTime]  DEFAULT (getdate()),
	[Sort] [int] NOT NULL CONSTRAINT [DF_Navs_Sort]  DEFAULT ((50)),
 CONSTRAINT [PK_Navs] 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]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[Permissions](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](50) NOT NULL,
	[CreateTime] [datetime] NOT NULL CONSTRAINT [DF_Permissions_CreateTime]  DEFAULT (getdate()),
	[LastModifyTime] [datetime] NOT NULL CONSTRAINT [DF_Permissions_LastModifyTime]  DEFAULT (getdate()),
	[Code] [nvarchar](100) NOT NULL,
 CONSTRAINT [PK_Permissions] 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]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[RolePermissions](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[RoleId] [int] NOT NULL,
	[PermissionId] [int] NOT NULL,
	[CreateTime] [datetime] NOT NULL CONSTRAINT [DF_RolePermissions_CreateTime]  DEFAULT (getdate()),
 CONSTRAINT [PK_RolePermissions] 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]


SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[Roles](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](50) NOT NULL,
	[CreateTime] [datetime] NOT NULL CONSTRAINT [DF_Roles_CreateTime]  DEFAULT (getdate()),
	[LastModifyTime] [datetime] NOT NULL CONSTRAINT [DF_Roles_LastModifyTime]  DEFAULT (getdate()),
 CONSTRAINT [PK_Roles] 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]


SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[UserRoles](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[UserId] [int] NOT NULL,
	[RoleId] [int] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
 CONSTRAINT [PK_UserRoles] 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]

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE TABLE [dbo].[Users](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[LoginId] [nvarchar](100) NOT NULL,
	[Password] [nvarchar](100) NOT NULL,
	[Type] [int] NOT NULL,
	[Nickname] [nvarchar](100) NOT NULL,
	[Portrait] [nvarchar](2000) NULL,
	[LastLoginTime] [datetime] NOT NULL CONSTRAINT [DF_Users_LastLoginTime_1]  DEFAULT (getdate()),
	[RegIp] [nvarchar](100) NULL,
	[Exp] [int] NOT NULL CONSTRAINT [DF_Users_Exp]  DEFAULT ((0)),
	[Lv] [int] NOT NULL CONSTRAINT [DF_Users_Lv]  DEFAULT ((1)),
	[CreateTime] [datetime] NOT NULL CONSTRAINT [DF_Users_CreateTime]  DEFAULT (getdate()),
	[LastModifyTime] [datetime] NOT NULL CONSTRAINT [DF_Users_LastModifyTime_1]  DEFAULT (getdate()),
	[Status] [int] NOT NULL CONSTRAINT [DF_Users_Status]  DEFAULT ((1)),
	[Email] [nvarchar](200) NULL,
	[Mobile] [nvarchar](50) NULL,
	[TotalExp] [int] NOT NULL CONSTRAINT [DF_Users_TotalExp]  DEFAULT ((0)),
 CONSTRAINT [PK_Users] 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]
SET ANSI_PADDING ON
CREATE UNIQUE NONCLUSTERED INDEX [UQ_Users_1] ON [dbo].[Users]
(
	[LoginId] 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]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[WebConfigs](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](100) NOT NULL,
	[ConfigKey] [nvarchar](100) NOT NULL,
	[ConfigValue] [nvarchar](max) NULL,
	[CreateTime] [datetime] NOT NULL CONSTRAINT [DF_WebConfigs_CreateTime]  DEFAULT (getdate()),
	[LastModifyTime] [datetime] NOT NULL CONSTRAINT [DF_WebConfigs_LastModifyTime]  DEFAULT (getdate()),
	[Description] [nvarchar](max) NULL,
 CONSTRAINT [PK_WebConfigs] 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]


CREATE UNIQUE NONCLUSTERED INDEX [UQ_ArticleStats_1] ON [dbo].[ArticleStats]
(
	[Date] ASC,
	[Type] 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]

ALTER TABLE [dbo].[UserRoles] ADD  CONSTRAINT [DF_UserRoles_CreateTime]  DEFAULT (getdate()) FOR [CreateTime]


SET IDENTITY_INSERT [dbo].[Permissions] ON 

INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (1, N'文章列表', CAST(N'2018-01-15 16:31:20.003' AS DateTime), CAST(N'2018-01-15 16:31:20.003' AS DateTime), N'articles_index')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (2, N'文章编辑', CAST(N'2018-01-15 16:31:20.110' AS DateTime), CAST(N'2018-01-15 16:31:20.110' AS DateTime), N'articles_edit')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (3, N'文章删除', CAST(N'2018-02-28 16:29:07.693' AS DateTime), CAST(N'2018-02-28 16:29:07.693' AS DateTime), N'article_delete')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (4, N'分类列表', CAST(N'2018-01-15 16:31:20.117' AS DateTime), CAST(N'2018-01-15 16:31:20.117' AS DateTime), N'categories_index')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (5, N'分类编辑', CAST(N'2018-01-15 16:31:20.117' AS DateTime), CAST(N'2018-01-15 16:31:20.117' AS DateTime), N'categories_edit')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (6, N'分类删除', CAST(N'2018-02-28 16:29:07.817' AS DateTime), CAST(N'2018-02-28 16:29:07.817' AS DateTime), N'categories_delete')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (7, N'轮播图列表', CAST(N'2018-01-15 16:32:19.560' AS DateTime), CAST(N'2018-01-15 16:32:19.560' AS DateTime), N'flashimages_index')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (8, N'轮播图编辑', CAST(N'2018-01-15 16:32:19.563' AS DateTime), CAST(N'2018-01-15 16:32:19.563' AS DateTime), N'flashimages_edit')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (9, N'轮播图删除', CAST(N'2018-02-28 16:29:07.840' AS DateTime), CAST(N'2018-02-28 16:29:07.840' AS DateTime), N'flashimages_delete')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (10, N'导航列表', CAST(N'2018-01-15 16:33:00.923' AS DateTime), CAST(N'2018-01-15 16:33:00.923' AS DateTime), N'navs_index')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (11, N'导航编辑', CAST(N'2018-01-15 16:33:00.927' AS DateTime), CAST(N'2018-01-15 16:33:00.927' AS DateTime), N'navs_edit')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (12, N'导航删除', CAST(N'2018-02-28 16:29:07.843' AS DateTime), CAST(N'2018-02-28 16:29:07.843' AS DateTime), N'navs_delete')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (13, N'网站配置', CAST(N'2018-01-15 16:35:27.517' AS DateTime), CAST(N'2018-01-15 16:35:27.517' AS DateTime), N'webconfigs_index')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (14, N'站点地图', CAST(N'2018-01-15 16:35:27.520' AS DateTime), CAST(N'2018-01-15 16:35:27.520' AS DateTime), N'sitemaps_index')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (15, N'生成站点地图', CAST(N'2018-01-15 16:36:49.983' AS DateTime), CAST(N'2018-01-15 16:36:49.983' AS DateTime), N'sitemaps_create')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (16, N'广告列表', CAST(N'2018-01-15 16:36:49.983' AS DateTime), CAST(N'2018-01-15 16:36:49.983' AS DateTime), N'advertisements_index')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (17, N'广告编辑', CAST(N'2018-01-15 16:36:49.983' AS DateTime), CAST(N'2018-01-15 16:36:49.983' AS DateTime), N'advertisements_edit')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (18, N'用户列表', CAST(N'2018-01-15 16:36:49.983' AS DateTime), CAST(N'2018-01-15 16:36:49.983' AS DateTime), N'users_index')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (19, N'用户编辑', CAST(N'2018-01-15 16:36:49.983' AS DateTime), CAST(N'2018-01-15 16:36:49.983' AS DateTime), N'users_edit')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (20, N'角色权限列表', CAST(N'2018-01-15 16:36:49.983' AS DateTime), CAST(N'2018-01-15 16:36:49.983' AS DateTime), N'roles_index')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (21, N'角色权限编辑', CAST(N'2018-01-15 16:36:49.983' AS DateTime), CAST(N'2018-01-15 16:36:49.983' AS DateTime), N'roles_edit')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (22, N'角色权限删除', CAST(N'2018-01-15 16:36:49.983' AS DateTime), CAST(N'2018-01-15 16:36:49.983' AS DateTime), N'roles_delete')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (23, N'菜单列表', CAST(N'2018-01-15 16:36:49.983' AS DateTime), CAST(N'2018-01-15 16:36:49.983' AS DateTime), N'menus_index')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (24, N'菜单编辑', CAST(N'2018-01-15 16:36:49.983' AS DateTime), CAST(N'2018-01-15 16:36:49.983' AS DateTime), N'menus_edit')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (25, N'友情链接列表', CAST(N'2018-01-15 16:36:49.983' AS DateTime), CAST(N'2018-01-15 16:36:49.983' AS DateTime), N'friendlinks_index')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (26, N'友情链接编辑', CAST(N'2018-01-15 16:36:49.983' AS DateTime), CAST(N'2018-01-15 16:36:49.983' AS DateTime), N'friendlinks_edit')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (27, N'友情链接删除', CAST(N'2018-01-15 16:36:49.983' AS DateTime), CAST(N'2018-01-15 16:36:49.983' AS DateTime), N'friendlinks_delete')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (28, N'评论列表', CAST(N'2018-01-15 16:36:49.983' AS DateTime), CAST(N'2018-01-15 16:36:49.983' AS DateTime), N'comments_index')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (29, N'评论删除', CAST(N'2018-01-15 16:36:49.983' AS DateTime), CAST(N'2018-01-15 16:36:49.983' AS DateTime), N'comments_delete')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (30, N'帖子列表', CAST(N'2018-01-15 16:36:49.983' AS DateTime), CAST(N'2018-01-15 16:36:49.983' AS DateTime), N'posts_index')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (31, N'帖子编辑', CAST(N'2018-01-15 16:36:49.983' AS DateTime), CAST(N'2018-01-15 16:36:49.983' AS DateTime), N'posts_edit')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (32, N'帖子删除', CAST(N'2018-01-15 16:36:49.983' AS DateTime), CAST(N'2018-01-15 16:36:49.983' AS DateTime), N'posts_delete')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (33, N'回帖列表', CAST(N'2018-01-15 16:36:49.983' AS DateTime), CAST(N'2018-01-15 16:36:49.983' AS DateTime), N'postcomments_index')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (34, N'回帖删除', CAST(N'2018-01-15 16:36:49.983' AS DateTime), CAST(N'2018-01-15 16:36:49.983' AS DateTime), N'postcomments_delete')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (35, N'社区板块列表', CAST(N'2018-01-15 16:36:49.983' AS DateTime), CAST(N'2018-01-15 16:36:49.983' AS DateTime), N'forums_index')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (36, N'社区板块编辑', CAST(N'2018-01-15 16:36:49.983' AS DateTime), CAST(N'2018-01-15 16:36:49.983' AS DateTime), N'forums_edit')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (37, N'社区板块删除', CAST(N'2018-01-15 16:36:49.983' AS DateTime), CAST(N'2018-01-15 16:36:49.983' AS DateTime), N'forums_delete')
INSERT [dbo].[Permissions] ([Id], [Name], [CreateTime], [LastModifyTime], [Code]) VALUES (38, N'社区板块用户查询', CAST(N'2018-01-15 16:36:49.983' AS DateTime), CAST(N'2018-01-15 16:36:49.983' AS DateTime), N'forums_users')


SET IDENTITY_INSERT [dbo].[Permissions] OFF


SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE TABLE [dbo].[Advertisements](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](100) NOT NULL,
	[Code] [nvarchar](100) NOT NULL,
	[AContent] [nvarchar](max) NULL,
	[IsEnable] [bit] NOT NULL CONSTRAINT [DF_Advertisements_IsEnable]  DEFAULT ((1)),
	[CreateTime] [datetime] NOT NULL CONSTRAINT [DF_Advertisements_CreateTime]  DEFAULT (getdate()),
	[LastModifyTime] [datetime] NOT NULL CONSTRAINT [DF_Advertisements_LastModifyTime]  DEFAULT (getdate()),
 CONSTRAINT [PK_Advertisements] 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]
SET ANSI_PADDING ON
CREATE UNIQUE NONCLUSTERED INDEX [UQ_Advertisements_1] ON [dbo].[Advertisements]
(
	[Code] 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]


SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE TABLE [dbo].[PostComments](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[CContent] [nvarchar](max) NOT NULL,
	[UserId] [int] NOT NULL,
	[PostId] [int] NOT NULL,
	[CreateTime] [datetime] NOT NULL CONSTRAINT [DF_PostComments_CreateTime]  DEFAULT (getdate()),
	[LastModifyTime] [datetime] NOT NULL CONSTRAINT [DF_PostComments_LastModifyTime]  DEFAULT (getdate()),
	[ParentId] [int] NULL,
	[Ip] [nvarchar](100) NULL,
	[IsDelete] [bit] NOT NULL CONSTRAINT [DF_PostComments_IsDelete]  DEFAULT ((0)),
 CONSTRAINT [PK_PostComments] 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]

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE TABLE [dbo].[Forums](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](50) NOT NULL,
	[Description] [nvarchar](max) NULL,
	[Sort] [int] NOT NULL CONSTRAINT [DF_Forums_Sort]  DEFAULT ((50)),
	[IsEnable] [bit] NOT NULL CONSTRAINT [DF_Forums_IsEnable]  DEFAULT ((1)),
	[Icon] [nvarchar](max) NULL,
	[Tags] [nvarchar](max) NULL,
	[CreateTime] [datetime] NOT NULL CONSTRAINT [DF_Forums_CreateTime]  DEFAULT (getdate()),
	[LastModifyTime] [datetime] NOT NULL CONSTRAINT [DF_Forums_LastModifyTime]  DEFAULT (getdate()),
	[IsDelete] [bit] NOT NULL DEFAULT ((0)),
 CONSTRAINT [PK_Forums] 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]

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE TABLE [dbo].[Posts](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Title] [nvarchar](100) NOT NULL,
	[Description] [nvarchar](max) NULL,
	[Tags] [nvarchar](max) NULL,
	[PContent] [nvarchar](max) NOT NULL,
	[ForumId] [int] NOT NULL,
	[UserId] [int] NOT NULL,
	[CreateTime] [datetime] NOT NULL CONSTRAINT [DF_Posts_CreateTime]  DEFAULT (getdate()),
	[LastModifyTime] [datetime] NOT NULL CONSTRAINT [DF_Posts_LastModifyTime]  DEFAULT (getdate()),
	[ReadQuantity] [int] NOT NULL CONSTRAINT [DF_Posts_ReadQuantity]  DEFAULT ((0)),
	[CommentQuantity] [int] NOT NULL CONSTRAINT [DF_Posts_CommentQuantity]  DEFAULT ((0)),
	[IsTop] [bit] NOT NULL CONSTRAINT [DF_Posts_IsTop]  DEFAULT ((0)),
	[BlockId] [int] NULL,
	[LastUserId] [int] NULL,
	[LastCreateTime] [datetime] NULL,
	[IsEnable] [bit] NOT NULL CONSTRAINT [DF_Posts_IsEnable]  DEFAULT ((1)),
	[IsDelete] [bit] NOT NULL CONSTRAINT [DF_Posts_IsDelete]  DEFAULT ((0)),
 CONSTRAINT [PK_Posts] 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]

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE TABLE [dbo].[ExpRecords](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Exp] [int] NOT NULL,
	[Type] [int] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[UserId] [int] NOT NULL,
 CONSTRAINT [PK_ExpRecords] 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]

CREATE NONCLUSTERED INDEX [IX_ExpRecords_1] ON [dbo].[ExpRecords]
(
	[UserId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
ALTER TABLE [dbo].[ExpRecords] ADD  CONSTRAINT [DF_ExpRecords_CreateTime]  DEFAULT (getdate()) FOR [CreateTime]

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE TABLE [dbo].[LvExps](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Lv] [int] NOT NULL,
	[Exp] [int] NOT NULL,
 CONSTRAINT [PK_LvExps] 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]


insert into menus(name,ParentId,PermissionId,Icon,url)
values('后台管理',null,0,null,null)
declare @p1 int
select @p1=id from menus where name ='后台管理'
insert into menus(name,ParentId,PermissionId,Icon,url)
values('菜单管理',@p1,0,null,'/Manage/Menus')
insert into menus(name,ParentId,PermissionId,Icon,url)
values('角色权限',@p1,0,null,'/Manage/Roles')
insert into menus(name,ParentId,PermissionId,Icon,url)
values('用户信息',@p1,0,null,'/Manage/Users')
insert into menus(name,ParentId,PermissionId,Icon,url)
values('网站管理',null,0,null,null)
declare @p3 int
select @p3=id from menus where name ='网站管理'
insert into menus(name,ParentId,PermissionId,Icon,url)
values('站点配置',@p3,0,null,'/Manage/WebConfigs')
insert into menus(name,ParentId,PermissionId,Icon,url)
values('站点地图',@p3,0,null,'/Manage/Sitemaps')

insert into menus(name,ParentId,PermissionId,Icon,url)
values('运营管理',null,0,null,null)
declare @p4 int
select @p4=id from menus where name ='运营管理'
insert into menus(name,ParentId,PermissionId,Icon,url)
values('广告管理',@p4,0,null,'/Manage/Advertisements')
insert into menus(name,ParentId,PermissionId,Icon,url)
values('友情链接管理',@p4,0,null,'/Manage/FriendLinks')

insert into menus(name,ParentId,PermissionId,Icon,url)
values('内容管理',null,0,null,null)
declare @p2 int
select @p2=id from menus where name ='内容管理'
insert into menus(name,ParentId,PermissionId,Icon,url)
values('文章管理',@p2,0,null,'/Manage/Articles')
insert into menus(name,ParentId,PermissionId,Icon,url)
values('评论管理',@p2,0,null,'/Manage/Comments')
insert into menus(name,ParentId,PermissionId,Icon,url)
values('社区板块管理',@p2,0,null,'/Manage/Forums')
insert into menus(name,ParentId,PermissionId,Icon,url)
values('帖子管理',@p2,0,null,'/Manage/Posts')
insert into menus(name,ParentId,PermissionId,Icon,url)
values('回帖管理',@p2,0,null,'/Manage/PostComments')
insert into menus(name,ParentId,PermissionId,Icon,url)
values('分类管理',@p2,0,null,'/Manage/Categories')
insert into menus(name,ParentId,PermissionId,Icon,url)
values('轮播图管理',@p2,0,null,'/Manage/FlashImages')
insert into menus(name,ParentId,PermissionId,Icon,url)
values('导航管理',@p2,0,null,'/Manage/Navs')



SET IDENTITY_INSERT [dbo].[Articles] ON 


INSERT [dbo].[Articles] ([Id], [Title], [Description], [UserId], [AContent], [CategoryId], [IsTop], [ReadQuantity], [Tags], [CoverImg], [CommentQuantity], [CreateTime], [LastModifyTime], [Sort], [IsDelete], [Status]) VALUES (1, N'示例文章一', N'这是一篇示例文章~这里显示的是描述信息。这篇文章包含一个封面图片，您可以在后台编辑或者删除这边文章！', 1, N'<p>这是一篇示例文章~</p><p>这里显示的是描述信息。</p><p>您可以在后台编辑或者删除这边文章！</p>', 1, 0, 0, N'示例,文章', N'/Static/Image/cover-demo.png', 0, CAST(N'2018-04-13 14:43:33.257' AS DateTime), CAST(N'2018-04-13 14:57:47.900' AS DateTime), 50, 0, 2)

INSERT [dbo].[Articles] ([Id], [Title], [Description], [UserId], [AContent], [CategoryId], [IsTop], [ReadQuantity], [Tags], [CoverImg], [CommentQuantity], [CreateTime], [LastModifyTime], [Sort], [IsDelete], [Status]) VALUES (2, N'示例文章二', N'这是一篇示例文章，这篇文章没有封面图片！', 1, N'<p>这是一篇示例文章，这篇文章没有封面图片！</p><p>如有问题请访问www.leavescn.com</p>', 2, 0, 0, N'示例,文章二', NULL, 0, CAST(N'2018-04-13 14:57:12.197' AS DateTime), CAST(N'2018-04-13 15:06:05.340' AS DateTime), 50, 0, 2)

SET IDENTITY_INSERT [dbo].[Articles] OFF

SET IDENTITY_INSERT [dbo].[Categories] ON 


INSERT [dbo].[Categories] ([Id], [Name], [Description]) VALUES (1, N'默认分类一', N'默认分类一')

INSERT [dbo].[Categories] ([Id], [Name], [Description]) VALUES (2, N'默认分类二', N'默认分类二')

SET IDENTITY_INSERT [dbo].[Categories] OFF

SET IDENTITY_INSERT [dbo].[Forums] ON 

INSERT [dbo].[Forums] ([Id], [Name], [Description],[Sort],[IsDelete],[IsEnable]) VALUES (1, N'示例板块', N'示例板块',50,0,1)

SET IDENTITY_INSERT [dbo].[Forums] OFF

SET IDENTITY_INSERT [dbo].[FlashImages] ON

INSERT [dbo].[FlashImages] ([Id], [Description], [ImageUrl], [Link], [CreateTime], [LastModifyTime], [IsValid], [Sort], [Target]) VALUES (3, N'这是一个轮播图示例', N'/Static/Image/flash-demo.jpg', N'http://www.leavescn.com', CAST(N'2018-04-13 14:49:25.303' AS DateTime), CAST(N'2018-04-13 14:51:50.930' AS DateTime), 1, 50, 1)

SET IDENTITY_INSERT [dbo].[FlashImages] OFF

SET IDENTITY_INSERT [dbo].[Navs] ON 


INSERT [dbo].[Navs] ([Id], [Text], [Target], [Url], [IsValid], [CreateTime], [LastModifyTime], [Sort]) VALUES (1, N'首页', 1, N'/', 1, CAST(N'2018-04-13 14:42:21.850' AS DateTime), CAST(N'2018-04-13 14:42:21.850' AS DateTime), 60)

INSERT [dbo].[Navs] ([Id], [Text], [Target], [Url], [IsValid], [CreateTime], [LastModifyTime], [Sort]) VALUES (2, N'最新文章', 1, N'/Articles', 1, CAST(N'2018-04-13 14:42:59.207' AS DateTime), CAST(N'2018-04-13 14:42:59.207' AS DateTime), 59)

INSERT [dbo].[Navs] ([Id], [Text], [Target], [Url], [IsValid], [CreateTime], [LastModifyTime], [Sort]) VALUES (3, N'默认分类一', 1, N'/Articles/Categories/1', 1, CAST(N'2018-04-13 14:42:59.207' AS DateTime), CAST(N'2018-04-13 14:42:59.207' AS DateTime), 58)

INSERT [dbo].[Navs] ([Id], [Text], [Target], [Url], [IsValid], [CreateTime], [LastModifyTime], [Sort]) VALUES (4, N'默认分类二', 1, N'/Articles/Categories/2', 1, CAST(N'2018-04-13 14:42:59.207' AS DateTime), CAST(N'2018-04-13 14:42:59.207' AS DateTime), 57)

INSERT [dbo].[Navs] ([Id], [Text], [Target], [Url], [IsValid], [CreateTime], [LastModifyTime], [Sort]) VALUES (5, N'社区', 1, N'/Forums', 1, CAST(N'2018-04-13 14:42:59.207' AS DateTime), CAST(N'2018-04-13 14:42:59.207' AS DateTime), 56)

SET IDENTITY_INSERT [dbo].[Navs] OFF

SET IDENTITY_INSERT [dbo].[WebConfigs] ON 


INSERT [dbo].[WebConfigs] ([Id], [Name], [ConfigKey], [ConfigValue], [CreateTime], [LastModifyTime], [Description]) VALUES (1, N'站点名称', N'SiteName', N'', CAST(N'2017-03-07 14:31:46.203' AS DateTime), CAST(N'2017-03-07 15:01:32.840' AS DateTime), NULL)

INSERT [dbo].[WebConfigs] ([Id], [Name], [ConfigKey], [ConfigValue], [CreateTime], [LastModifyTime], [Description]) VALUES (2, N'网站Logo', N'Logo', N'/favicon.ico', CAST(N'2017-03-07 14:31:46.203' AS DateTime), CAST(N'2018-04-13 14:11:05.667' AS DateTime), NULL)

INSERT [dbo].[WebConfigs] ([Id], [Name], [ConfigKey], [ConfigValue], [CreateTime], [LastModifyTime], [Description]) VALUES (3, N'站点地址', N'SiteAddress', N'', CAST(N'2017-03-07 14:31:46.203' AS DateTime), CAST(N'2017-03-07 14:31:46.203' AS DateTime), N'')

INSERT [dbo].[WebConfigs] ([Id], [Name], [ConfigKey], [ConfigValue], [CreateTime], [LastModifyTime], [Description]) VALUES (4, N'版权信息', N'Copyright', N'', CAST(N'2017-03-07 14:31:46.203' AS DateTime), CAST(N'2018-02-26 11:53:38.137' AS DateTime), NULL)

INSERT [dbo].[WebConfigs] ([Id], [Name], [ConfigKey], [ConfigValue], [CreateTime], [LastModifyTime], [Description]) VALUES (5, N'站长邮箱', N'Email', N'', CAST(N'2017-03-07 14:31:46.203' AS DateTime), CAST(N'2017-03-07 14:31:46.203' AS DateTime), NULL)

INSERT [dbo].[WebConfigs] ([Id], [Name], [ConfigKey], [ConfigValue], [CreateTime], [LastModifyTime], [Description]) VALUES (6, N'图片水印', N'Watermark', N'', CAST(N'2017-03-07 14:31:46.203' AS DateTime), CAST(N'2017-03-07 15:01:32.840' AS DateTime), NULL)

INSERT [dbo].[WebConfigs] ([Id], [Name], [ConfigKey], [ConfigValue], [CreateTime], [LastModifyTime], [Description]) VALUES (7, N'加水印条件', N'WatermarkStartWidth', N'420', CAST(N'2017-03-07 14:31:46.203' AS DateTime), CAST(N'2017-03-07 14:31:46.203' AS DateTime), N'当图片宽度大于配置值时，自动加水印图片，单位px')

INSERT [dbo].[WebConfigs] ([Id], [Name], [ConfigKey], [ConfigValue], [CreateTime], [LastModifyTime], [Description]) VALUES (8, N'统计代码', N'Statistic', N'', CAST(N'2017-03-07 14:35:32.250' AS DateTime), CAST(N'2018-04-13 11:14:15.533' AS DateTime), NULL)

INSERT [dbo].[WebConfigs] ([Id], [Name], [ConfigKey], [ConfigValue], [CreateTime], [LastModifyTime], [Description]) VALUES (9, N'网站关键字（SEO）', N'MetaKeywords', N'', CAST(N'2017-03-07 14:35:32.250' AS DateTime), CAST(N'2018-04-13 11:14:15.533' AS DateTime), N'网站关键字，首页Head标签中meta-keywords的内容，多个关键字请用英文“,”隔开')

INSERT [dbo].[WebConfigs] ([Id], [Name], [ConfigKey], [ConfigValue], [CreateTime], [LastModifyTime], [Description]) VALUES (10, N'网站描述（SEO）', N'MetaDescription', N'', CAST(N'2017-03-07 14:35:32.250' AS DateTime), CAST(N'2018-04-13 11:14:15.533' AS DateTime), N'网站描述，首页Head标签中meta-description的内容')

INSERT [dbo].[WebConfigs] ([Id], [Name], [ConfigKey], [ConfigValue], [CreateTime], [LastModifyTime], [Description]) VALUES (11, N'发帖等级要求', N'PostLvFrom', N'1', CAST(N'2017-03-07 14:35:32.250' AS DateTime), CAST(N'2018-04-13 11:14:15.533' AS DateTime), N'防止恶意发帖，输入0或者留空则不做限制')

INSERT [dbo].[WebConfigs] ([Id], [Name], [ConfigKey], [ConfigValue], [CreateTime], [LastModifyTime], [Description]) VALUES (12, N'资源文件夹CDN地址', N'AssetsCDN', N'', CAST(N'2017-03-07 14:35:32.250' AS DateTime), CAST(N'2018-04-13 11:14:15.533' AS DateTime), N'为Assets资源文件夹设置CDN地址，将会从CDN加载Assets资源文件夹里的文件，例如：https://cdn.domain.com')

SET IDENTITY_INSERT [dbo].[WebConfigs] OFF

INSERT INTO Advertisements(NAME,CODE)
VALUES('导航栏下方','Nav_Bottom')
INSERT INTO Advertisements(NAME,CODE)
VALUES('帖子正文上方','Post_Top')
INSERT INTO Advertisements(NAME,CODE)
VALUES('帖子正文下方','Post_Bottom')
INSERT INTO Advertisements(NAME,CODE)
VALUES('社区右侧栏顶部','Forums_Right_Top')
INSERT INTO Advertisements(NAME,CODE)
VALUES('社区右侧栏底部','Forums_Right_Bottom')
INSERT INTO Advertisements(NAME,CODE)
VALUES('帖子列表上方','Posts_Top')
INSERT INTO Advertisements(NAME,CODE)
VALUES('帖子列表下方','Posts_Bottom')
INSERT INTO Advertisements(NAME,CODE)
VALUES('社区板块列表下方','Forums_Bottom')

INSERT INTO Advertisements(NAME,CODE)
VALUES('用户中心右侧栏底部','User_Right_Bottom')
INSERT INTO Advertisements(NAME,CODE)
VALUES('用户中心右侧栏顶部','User_Right_Top')
INSERT INTO Advertisements(NAME,CODE)
VALUES('右侧栏底部','Right_Bottom')
INSERT INTO Advertisements(NAME,CODE)
VALUES('右侧栏顶部','Right_Top')
INSERT INTO Advertisements(NAME,CODE)
VALUES('正文底部','Content_Bottom')
INSERT INTO Advertisements(NAME,CODE)
VALUES('正文顶部','Content_Top')
INSERT INTO Advertisements(NAME,CODE)
VALUES('非首页文章列表底部','List_Bottom')
INSERT INTO Advertisements(NAME,CODE)
VALUES('非首页文章列表顶部','List_Top')
INSERT INTO Advertisements(NAME,CODE)
VALUES('首页文章列表底部','Home_List_Bottom')
INSERT INTO Advertisements(NAME,CODE)
VALUES('首页文章列表顶部','Home_List_Top')
INSERT INTO Advertisements(NAME,CODE)
VALUES('head标签之间','Html_Head')
UPDATE Advertisements set isenable = 0

insert into FriendLinks(text,description,target,url,isvalid,sort)
values('.NET绿叶社区','.NET绿叶社区',2,'https://www.leavescn.com',1,50)


insert into lvexps(lv,exp) values(1,5)
insert into lvexps(lv,exp) values(2,10)
insert into lvexps(lv,exp) values(3,15)
insert into lvexps(lv,exp) values(4,20)
insert into lvexps(lv,exp) values(5,25)
insert into lvexps(lv,exp) values(6,30)
insert into lvexps(lv,exp) values(7,35)
insert into lvexps(lv,exp) values(8,40)
insert into lvexps(lv,exp) values(9,45)
insert into lvexps(lv,exp) values(10,50)
insert into lvexps(lv,exp) values(11,55)
insert into lvexps(lv,exp) values(12,60)
insert into lvexps(lv,exp) values(13,65)
insert into lvexps(lv,exp) values(14,70)
insert into lvexps(lv,exp) values(15,75)
insert into lvexps(lv,exp) values(16,80)
insert into lvexps(lv,exp) values(17,85)
insert into lvexps(lv,exp) values(18,90)
insert into lvexps(lv,exp) values(19,95)
insert into lvexps(lv,exp) values(20,100)