增加通知表数据库结构

This commit is contained in:
Argo-Lenovo 2016-11-10 11:35:27 +08:00
parent e2ce12b0b8
commit 42d0c3e089
2 changed files with 43 additions and 28 deletions

View File

@ -6,15 +6,20 @@ SET IDENTITY_INSERT [dbo].[Users] ON
insert into Users (ID, UserName, Password, PassSalt, DisplayName, RegisterTime, ApprovedTime) values (1, 'Admin', 'Es7WVgNsJuELwWK8daCqufUBknCsSC0IYDphQZAiGOo=', 'W5vpBEOYRGHkQXatN0t+ECM/U8cHDuEgrq56+zZBk4J481xH', 'Administrator', GetDate(), GetDate())
SET IDENTITY_INSERT [dbo].[Users] OFF
DELETE From Dicts where ID in (1, 2, 3, 4)
DELETE From Dicts where ID < 10
SET IDENTITY_INSERT [dbo].[Dicts] ON
INSERT [dbo].[Dicts] ([ID], [Category], [Name], [Code], [Define]) VALUES (1, N'菜单', N'系统菜单', N'0', 0)
INSERT [dbo].[Dicts] ([ID], [Category], [Name], [Code], [Define]) VALUES (2, N'菜单', N'外部菜单', N'1', 0)
INSERT [dbo].[Dicts] ([ID], [Category], [Name], [Code], [Define]) VALUES (3, N'网站设置', N'网站标题', N'后台管理系统', 0)
INSERT [dbo].[Dicts] ([ID], [Category], [Name], [Code], [Define]) VALUES (4, N'网站设置', N'网站页脚', N'2016 © 通用后台管理系统', 0)
INSERT [dbo].[Dicts] ([ID], [Category], [Name], [Code], [Define]) VALUES (5, N'系统通知', N'用户注册', N'0', 0)
INSERT [dbo].[Dicts] ([ID], [Category], [Name], [Code], [Define]) VALUES (6, N'系统通知', N'程序异常', N'1', 0)
INSERT [dbo].[Dicts] ([ID], [Category], [Name], [Code], [Define]) VALUES (7, N'系统通知', N'数据库连接', N'2', 0)
INSERT [dbo].[Dicts] ([ID], [Category], [Name], [Code], [Define]) VALUES (8, N'通知状态', N'未处理', N'0', 0)
INSERT [dbo].[Dicts] ([ID], [Category], [Name], [Code], [Define]) VALUES (9, N'通知状态', N'已处理', N'1', 0)
SET IDENTITY_INSERT [dbo].[Dicts] OFF
DELETE FROM Navigations
DELETE FROM Navigations where ID < 15
SET IDENTITY_INSERT [dbo].[Navigations] ON
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (1, 0, N'后台管理', 1, N'fa fa-gear', N'~/Admin/Index', N'0')
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (2, 0, N'菜单管理', 10, N'fa fa-dashboard', N'~/Admin/Menus', N'0')

View File

@ -8,14 +8,13 @@ ALTER DATABASE [BootstrapAdmin] SET AUTO_SHRINK ON
GO
USE [BootstrapAdmin]
GO
/****** Object: Table [dbo].[Users] Script Date: 11/07/2016 11:45:40 ******/
/****** Object: Table [dbo].[Users] Script Date: 11/10/2016 11:32:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Users](
[ID] [int] IDENTITY(1,1) NOT NULL,
[UserName] [varchar](50) NOT NULL,
@ -30,34 +29,24 @@ CREATE TABLE [dbo].[Users](
[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]
GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Users', @level2type=N'COLUMN',@level2name=N'ID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Users', @level2type=N'COLUMN',@level2name=N'UserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'密码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Users', @level2type=N'COLUMN',@level2name=N'Password'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'密码盐' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Users', @level2type=N'COLUMN',@level2name=N'PassSalt'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'显示名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Users', @level2type=N'COLUMN',@level2name=N'DisplayName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'注册时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Users', @level2type=N'COLUMN',@level2name=N'RegisterTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'批复时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Users', @level2type=N'COLUMN',@level2name=N'ApprovedTime'
GO
/****** Object: Table [dbo].[UserRole] Script Date: 11/07/2016 11:45:40 ******/
/****** Object: Table [dbo].[UserRole] Script Date: 11/10/2016 11:32:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
@ -78,7 +67,7 @@ EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户ID' , @l
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'角色ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UserRole', @level2type=N'COLUMN',@level2name=N'RoleID'
GO
/****** Object: Table [dbo].[UserGroup] Script Date: 11/07/2016 11:45:40 ******/
/****** Object: Table [dbo].[UserGroup] Script Date: 11/10/2016 11:32:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
@ -99,7 +88,7 @@ EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户ID' , @l
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'部门ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UserGroup', @level2type=N'COLUMN',@level2name=N'GroupID'
GO
/****** Object: Table [dbo].[Roles] Script Date: 11/07/2016 11:45:40 ******/
/****** Object: Table [dbo].[Roles] Script Date: 11/10/2016 11:32:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
@ -120,7 +109,7 @@ EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'角色名称'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'描述' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Roles', @level2type=N'COLUMN',@level2name=N'Description'
GO
/****** Object: Table [dbo].[RoleGroup] Script Date: 11/07/2016 11:45:40 ******/
/****** Object: Table [dbo].[RoleGroup] Script Date: 11/10/2016 11:32:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
@ -141,7 +130,25 @@ EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'角色ID' , @l
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'部门ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'RoleGroup', @level2type=N'COLUMN',@level2name=N'GroupID'
GO
/****** Object: Table [dbo].[Navigations] Script Date: 11/07/2016 11:45:40 ******/
/****** Object: Table [dbo].[Notifications] Script Date: 11/10/2016 11:32:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Notifications](
[ID] [int] NOT NULL,
[Category] [nvarchar](50) NOT NULL,
[Title] [nvarchar](50) NOT NULL,
[Content] [nvarchar](50) NOT NULL,
[RegisterTime] [datetime] NOT NULL,
[ProcessTime] [datetime] NULL,
[ProcessBy] [nvarchar](50) NULL,
[Status] [nvarchar](50) NOT NULL
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'0 标示未处理 1 标示已处理' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Notifications', @level2type=N'COLUMN',@level2name=N'Status'
GO
/****** Object: Table [dbo].[Navigations] Script Date: 11/10/2016 11:32:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
@ -164,7 +171,7 @@ CREATE TABLE [dbo].[Navigations](
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[NavigationRole] Script Date: 11/07/2016 11:45:40 ******/
/****** Object: Table [dbo].[NavigationRole] Script Date: 11/10/2016 11:32:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
@ -179,7 +186,7 @@ CREATE TABLE [dbo].[NavigationRole](
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[Logs] Script Date: 11/07/2016 11:45:40 ******/
/****** Object: Table [dbo].[Logs] Script Date: 11/10/2016 11:32:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
@ -206,7 +213,7 @@ EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0typ
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Logs', @level2type=N'COLUMN',@level2name=N'CRUD'
GO
/****** Object: Table [dbo].[Groups] Script Date: 11/07/2016 11:45:40 ******/
/****** Object: Table [dbo].[Groups] Script Date: 11/10/2016 11:32:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
@ -227,7 +234,7 @@ EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'部门名称'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'描述' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Groups', @level2type=N'COLUMN',@level2name=N'Description'
GO
/****** Object: Table [dbo].[Dicts] Script Date: 11/07/2016 11:45:40 ******/
/****** Object: Table [dbo].[Dicts] Script Date: 11/10/2016 11:32:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
@ -254,18 +261,21 @@ EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'字典代码'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'0表示系统使用1表示自定义' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Dicts', @level2type=N'COLUMN',@level2name=N'Define'
GO
/****** Object: Default [DF_Dicts_Define] Script Date: 11/07/2016 11:45:40 ******/
/****** Object: Default [DF_Dicts_Define] Script Date: 11/10/2016 11:32:54 ******/
ALTER TABLE [dbo].[Dicts] ADD CONSTRAINT [DF_Dicts_Define] DEFAULT ((1)) FOR [Define]
GO
/****** Object: Default [DF_Navigations_ParentId] Script Date: 11/07/2016 11:45:40 ******/
/****** Object: Default [DF_Navigations_ParentId] Script Date: 11/10/2016 11:32:54 ******/
ALTER TABLE [dbo].[Navigations] ADD CONSTRAINT [DF_Navigations_ParentId] DEFAULT ((0)) FOR [ParentId]
GO
/****** Object: Default [DF_Navigations_Order] Script Date: 11/07/2016 11:45:40 ******/
/****** Object: Default [DF_Navigations_Order] Script Date: 11/10/2016 11:32:54 ******/
ALTER TABLE [dbo].[Navigations] ADD CONSTRAINT [DF_Navigations_Order] DEFAULT ((0)) FOR [Order]
GO
/****** Object: Default [DF_Navigations_Icon] Script Date: 11/07/2016 11:45:40 ******/
/****** Object: Default [DF_Navigations_Icon] Script Date: 11/10/2016 11:32:54 ******/
ALTER TABLE [dbo].[Navigations] ADD CONSTRAINT [DF_Navigations_Icon] DEFAULT ('none') FOR [Icon]
GO
/****** Object: Default [DF_Navigations_Category] Script Date: 11/07/2016 11:45:40 ******/
/****** Object: Default [DF_Navigations_Category] Script Date: 11/10/2016 11:32:54 ******/
ALTER TABLE [dbo].[Navigations] ADD CONSTRAINT [DF_Navigations_Category] DEFAULT ((0)) FOR [Category]
GO
/****** Object: Default [DF_Notifications_Status] Script Date: 11/10/2016 11:32:54 ******/
ALTER TABLE [dbo].[Notifications] ADD CONSTRAINT [DF_Notifications_Status] DEFAULT ((0)) FOR [Status]
GO