From c6803b4c5406eb25c9117d95119fa7c7759fae94 Mon Sep 17 00:00:00 2001 From: renshuo Date: Mon, 31 Oct 2016 13:08:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=95=B0=E6=8D=AE=E5=BA=93=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E8=BF=9B=E8=A1=8C=E6=95=B4=E7=90=86=EF=BC=8C=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=94=A8=E6=88=B7Admin=EF=BC=8C=E5=AF=86=E7=A0=811237?= =?UTF-8?q?89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DatabaseScripts/Install.sql | 339 ++++++++++++++++++------------------ 1 file changed, 174 insertions(+), 165 deletions(-) diff --git a/DatabaseScripts/Install.sql b/DatabaseScripts/Install.sql index ac210bd1..9f4486ee 100644 --- a/DatabaseScripts/Install.sql +++ b/DatabaseScripts/Install.sql @@ -1,31 +1,28 @@ USE [master] GO - Create database [BootstrapAdmin] GO - ALTER DATABASE [BootstrapAdmin] SET RECOVERY SIMPLE GO - ALTER DATABASE [BootstrapAdmin] SET AUTO_SHRINK ON GO - USE [BootstrapAdmin] GO + /****** Object: Table [dbo].[Users] Script Date: 10/24/2016 15:48:24 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Users]( - [ID] [int] IDENTITY(1,1) NOT NULL, - [UserName] [varchar](50) NOT NULL, - [Password] [varchar](50) NOT NULL, - [PassSalt] [varchar](50) NOT NULL, - [DisplayName] [nvarchar](50) NOT NULL, + [ID] [int] IDENTITY(1,1) NOT NULL, + [UserName] [varchar](50) NOT NULL, + [Password] [varchar](50) NOT NULL, + [PassSalt] [varchar](50) NOT NULL, + [DisplayName] [nvarchar](50) NOT NULL, CONSTRAINT [PK_Users] PRIMARY KEY CLUSTERED ( - [ID] ASC + [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 @@ -39,102 +36,23 @@ 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'Users', @level2type=N'COLUMN',@level2name=N'DisplayName' GO -/****** Object: Table [dbo].[UserRole] Script Date: 10/22/2016 09:44:03 ******/ -SET ANSI_NULLS ON -GO -SET QUOTED_IDENTIFIER ON -GO -CREATE TABLE [dbo].[UserRole]( - [ID] [int] IDENTITY(1,1) NOT NULL, - [UserID] [int] NOT NULL, - [RoleID] [int] NOT NULL, - CONSTRAINT [PK_UserRole] 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] -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'ID' -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'UserID' -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: 10/22/2016 09:44:03 ******/ -SET ANSI_NULLS ON -GO -SET QUOTED_IDENTIFIER ON -GO -CREATE TABLE [dbo].[UserGroup]( - [ID] [int] IDENTITY(1,1) NOT NULL, - [UserID] [int] NOT NULL, - [GroupID] [int] NOT NULL, - CONSTRAINT [PK_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] -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'ID' -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'UserID' -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: 10/22/2016 09:44:03 ******/ -SET ANSI_NULLS ON -GO -SET QUOTED_IDENTIFIER ON -GO -CREATE TABLE [dbo].[Roles]( - [ID] [int] IDENTITY(1,1) NOT NULL, - [RoleName] [nvarchar](50) NULL, - [Description] [nvarchar](500) NULL, - 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] -GO -EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Roles', @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'Roles', @level2type=N'COLUMN',@level2name=N'RoleName' -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: 10/22/2016 09:44:03 ******/ -SET ANSI_NULLS ON -GO -SET QUOTED_IDENTIFIER ON -GO -CREATE TABLE [dbo].[RoleGroup]( - [ID] [int] IDENTITY(1,1) NOT NULL, - [RoleID] [int] NOT NULL, - [GroupID] [int] NOT NULL, - CONSTRAINT [PK_RoleGroup] 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] -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'ID' -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'RoleID' -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' + +/* added by argo the default password is 123789 */ +insert into Users (UserName, Password, PassSalt, DisplayName) values ('Admin', 'Es7WVgNsJuELwWK8daCqufUBknCsSC0IYDphQZAiGOo=', 'W5vpBEOYRGHkQXatN0t+ECM/U8cHDuEgrq56+zZBk4J481xH', 'Administrator') GO + /****** Object: Table [dbo].[Groups] Script Date: 10/22/2016 09:44:03 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Groups]( - [ID] [int] IDENTITY(1,1) NOT NULL, - [GroupName] [nvarchar](50) NULL, - [Description] [nvarchar](500) NULL, + [ID] [int] IDENTITY(1,1) NOT NULL, + [GroupName] [nvarchar](50) NULL, + [Description] [nvarchar](500) NULL, CONSTRAINT [PK_Groups] PRIMARY KEY CLUSTERED ( - [ID] ASC + [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 @@ -145,84 +63,95 @@ 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].[Logs] Script Date: 10/28/2016 16:39:11 ******/ +/****** Object: Table [dbo].[Roles] Script Date: 10/22/2016 09:44:03 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -CREATE TABLE [dbo].[Logs]( - [ID] [int] IDENTITY(1,1) NOT NULL, - [OperationType] [int] NULL, - [UserID] [int] NULL, - [OperationTime] [datetime] NULL, - [TableName] [nvarchar](50) NULL, - [BusinessName] [nvarchar](50) NULL, - [PrimaryKey] [nvarchar](50) NULL, - [SqlText] [nvarchar](max) NULL, - [OperationIp] [nvarchar](50) NULL, - CONSTRAINT [PK_Logs] PRIMARY KEY CLUSTERED +CREATE TABLE [dbo].[Roles]( + [ID] [int] IDENTITY(1,1) NOT NULL, + [RoleName] [nvarchar](50) NULL, + [Description] [nvarchar](500) NULL, + CONSTRAINT [PK_Roles] PRIMARY KEY CLUSTERED ( - [ID] ASC + [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 -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'ID' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Roles', @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'Logs', @level2type=N'COLUMN',@level2name=N'OperationType' +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'RoleName' +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 -CREATE TABLE [dbo].[Navigations]( - [ID] [int] IDENTITY(1,1) NOT NULL, - [ParentId] [int] NOT NULL, - [Name] [nvarchar](50) NOT NULL, - [Order] [int] NOT NULL, - [Icon] [varchar](50) NULL, - [Url] [varchar](50) NULL, - [Category] [nvarchar](50) NOT NULL, - CONSTRAINT [PK_Navigations] 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] - -GO - - -/****** Object: Table [dbo].[NavigationRole] Script Date: 10/28/2016 15:14:35 ******/ +/****** Object: Table [dbo].[UserGroup] Script Date: 10/22/2016 09:44:03 ******/ SET ANSI_NULLS ON GO - SET QUOTED_IDENTIFIER ON GO - -CREATE TABLE [dbo].[NavigationRole]( - [ID] [int] IDENTITY(1,1) NOT NULL, - [NavigationID] [int] NOT NULL, - [RoleID] [int] NOT NULL, - CONSTRAINT [PK_NavigationRole] PRIMARY KEY CLUSTERED +CREATE TABLE [dbo].[UserGroup]( + [ID] [int] IDENTITY(1,1) NOT NULL, + [UserID] [int] NOT NULL, + [GroupID] [int] NOT NULL, + CONSTRAINT [PK_UserGroup] PRIMARY KEY CLUSTERED ( - [ID] ASC + [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 +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'ID' +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'UserID' +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 -SET ANSI_PADDING OFF +/****** Object: Table [dbo].[UserRole] Script Date: 10/22/2016 09:44:03 ******/ +SET ANSI_NULLS ON +GO +SET QUOTED_IDENTIFIER ON +GO +CREATE TABLE [dbo].[UserRole]( + [ID] [int] IDENTITY(1,1) NOT NULL, + [UserID] [int] NOT NULL, + [RoleID] [int] NOT NULL, + CONSTRAINT [PK_UserRole] 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] +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'ID' +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'UserID' +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 -ALTER TABLE [dbo].[Navigations] ADD CONSTRAINT [DF_Navigations_ParentId] DEFAULT ((0)) FOR [ParentId] +/****** Object: Table [dbo].[RoleGroup] Script Date: 10/22/2016 09:44:03 ******/ +SET ANSI_NULLS ON +GO +SET QUOTED_IDENTIFIER ON +GO +CREATE TABLE [dbo].[RoleGroup]( + [ID] [int] IDENTITY(1,1) NOT NULL, + [RoleID] [int] NOT NULL, + [GroupID] [int] NOT NULL, + CONSTRAINT [PK_RoleGroup] 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] +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'ID' +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'RoleID' +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 -ALTER TABLE [dbo].[Navigations] ADD CONSTRAINT [DF_Navigations_Order] DEFAULT ((0)) FOR [Order] -GO - -ALTER TABLE [dbo].[Navigations] ADD CONSTRAINT [DF_Navigations_Icon] DEFAULT ('none') FOR [Icon] -GO - -ALTER TABLE [dbo].[Navigations] ADD CONSTRAINT [DF_Navigations_Category] DEFAULT ((0)) FOR [Category] -GO - -/****** Object: Table [dbo].[Dicts] Script Date: 2016/10/27 星期四 16:35:54 ******/ +/****** Object: Table [dbo].[Dicts] Script Date: 2016/10/31 星期一 11:33:42 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON @@ -230,26 +159,106 @@ GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[Dicts]( - [ID] [int] IDENTITY(1,1) NOT NULL, - [Category] [nvarchar](50) NOT NULL, - [Name] [nvarchar](50) NOT NULL, - [Code] [varchar](50) NOT NULL, + [ID] [int] IDENTITY(1,1) NOT NULL, + [Category] [nvarchar](50) NOT NULL, + [Name] [nvarchar](50) NOT NULL, + [Code] [varchar](50) NOT NULL, CONSTRAINT [PK_dbo.Dict] PRIMARY KEY CLUSTERED ( - [ID] ASC + [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'Dicts', @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'Dicts', @level2type=N'COLUMN',@level2name=N'Category' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'字典名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Dicts', @level2type=N'COLUMN',@level2name=N'Name' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'字典代码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Dicts', @level2type=N'COLUMN',@level2name=N'Code' +GO -SET IDENTITY_INSERT Navigations ON -insert into Navigations (ID, Name, [Order], Icon, Url) values (1, '菜单管理', 10, 'fa fa-dashboard', '~/Admin/Menus') -insert into Navigations (ID, Name, [Order], Icon, Url) values (2, '用户管理', 20, 'fa fa-user', '~/Admin/Users') -insert into Navigations (ID, Name, [Order], Icon, Url) values (3, '角色管理', 30, 'fa fa-sitemap', '~/Admin/Roles') -insert into Navigations (ID, Name, [Order], Icon, Url) values (4, '部门管理', 40, 'fa fa-home', '~/Admin/Groups') -insert into Navigations (ID, Name, [Order], Icon, Url) values (5, '字典表维护', 50, 'fa fa-book', '~/Admin/Dicts') -insert into Navigations (ID, Name, [Order], Icon, Url) values (6, '个性化维护', 60, 'fa fa-pencil', '~/Admin/Profiles') -insert into Navigations (ID, Name, [Order], Icon, Url) values (7, '系统日志', 70, 'fa fa-gears', '~/Admin/EventLog') -SET IDENTITY_INSERT Navigations OFF \ No newline at end of file +SET IDENTITY_INSERT [dbo].[Dicts] ON +INSERT [dbo].[Dicts] ([ID], [Category], [Name], [Code]) VALUES (1, N'菜单', N'系统菜单', N'0') +INSERT [dbo].[Dicts] ([ID], [Category], [Name], [Code]) VALUES (2, N'菜单', N'外部菜单', N'1') +SET IDENTITY_INSERT [dbo].[Dicts] OFF + +/****** Object: Table [dbo].[Logs] Script Date: 10/28/2016 16:39:11 ******/ +SET ANSI_NULLS ON +GO +SET QUOTED_IDENTIFIER ON +GO +CREATE TABLE [dbo].[Logs]( + [ID] [int] IDENTITY(1,1) NOT NULL, + [OperationType] [int] NULL, + [UserID] [int] NULL, + [OperationTime] [datetime] NULL, + [TableName] [nvarchar](50) NULL, + [BusinessName] [nvarchar](50) NULL, + [PrimaryKey] [nvarchar](50) NULL, + [SqlText] [nvarchar](max) NULL, + [OperationIp] [nvarchar](50) 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] +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'ID' +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'OperationType' +GO +/****** Object: Table [dbo].[Navigations] ******/ +CREATE TABLE [dbo].[Navigations]( + [ID] [int] IDENTITY(1,1) NOT NULL, + [ParentId] [int] NOT NULL, + [Name] [nvarchar](50) NOT NULL, + [Order] [int] NOT NULL, + [Icon] [varchar](50) NULL, + [Url] [varchar](50) NULL, + [Category] [nvarchar](50) NOT NULL, + CONSTRAINT [PK_Navigations] 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] +GO + +SET IDENTITY_INSERT [dbo].[Navigations] ON +INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (1, 0, N'菜单管理', 10, N'fa fa-dashboard', N'~/Admin/Menus', N'0') +INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (2, 0, N'用户管理', 20, N'fa fa-user', N'~/Admin/Users', N'0') +INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (3, 0, N'角色管理', 30, N'fa fa-sitemap', N'~/Admin/Roles', N'0') +INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (4, 0, N'部门管理', 40, N'fa fa-home', N'~/Admin/Groups', N'0') +INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (5, 0, N'字典表维护', 50, N'fa fa-book', N'~/Admin/Dicts', N'0') +INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (6, 0, N'个性化维护', 60, N'fa fa-pencil', N'~/Admin/Profiles', N'0') +INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (7, 0, N'系统日志', 70, N'fa fa-gears', N'~/Admin/Logs', N'0') +SET IDENTITY_INSERT [dbo].[Navigations] OFF + +/****** Object: Table [dbo].[NavigationRole] Script Date: 10/28/2016 15:14:35 ******/ +SET ANSI_NULLS ON +GO +SET QUOTED_IDENTIFIER ON +GO +CREATE TABLE [dbo].[NavigationRole]( + [ID] [int] IDENTITY(1,1) NOT NULL, + [NavigationID] [int] NOT NULL, + [RoleID] [int] NOT NULL, + CONSTRAINT [PK_NavigationRole] 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] +GO +SET ANSI_PADDING OFF +GO +ALTER TABLE [dbo].[Navigations] ADD CONSTRAINT [DF_Navigations_ParentId] DEFAULT ((0)) FOR [ParentId] +GO +ALTER TABLE [dbo].[Navigations] ADD CONSTRAINT [DF_Navigations_Order] DEFAULT ((0)) FOR [Order] +GO +ALTER TABLE [dbo].[Navigations] ADD CONSTRAINT [DF_Navigations_Icon] DEFAULT ('none') FOR [Icon] +GO +ALTER TABLE [dbo].[Navigations] ADD CONSTRAINT [DF_Navigations_Category] DEFAULT ((0)) FOR [Category] +GO