fix(script): update db sql for mssqlserver
This commit is contained in:
parent
8e4ef25cde
commit
3c9dd990e2
|
@ -118,21 +118,21 @@ INSERT [dbo].[Roles] ([RoleName], [Description]) VALUES (N'Default', N'默认用
|
|||
|
||||
-- 角色部门关联
|
||||
TRUNCATE Table RoleGroup
|
||||
INSERT INTO RoleGroup (GroupId, RoleId) SELECT g.Id, r.Id From Groups g left join Roles r on 1=1 where GroupName = 'Admin' and RoleName = 'Administrators'
|
||||
INSERT INTO RoleGroup (GroupId, RoleId) SELECT g.Id, r.Id From Groups g left join Roles r on 1=1 where GroupName = 'Admin' and RoleName = N'Administrators'
|
||||
|
||||
-- 用户部门关联
|
||||
TRUNCATE Table UserGroup
|
||||
|
||||
-- 用户角色关联
|
||||
TRUNCATE Table UserRole
|
||||
INSERT INTO UserRole (UserId, RoleId) SELECT u.Id, r.Id From Users u left join Roles r on 1=1 where UserName = 'Admin' and RoleName = 'Administrators'
|
||||
INSERT INTO UserRole (UserId, RoleId) SELECT u.Id, r.Id From Users u left join Roles r on 1=1 where UserName = 'User' and RoleName = 'Default'
|
||||
INSERT INTO UserRole (UserId, RoleId) SELECT u.Id, r.Id From Users u left join Roles r on 1=1 where UserName = 'Admin' and RoleName = N'Administrators'
|
||||
INSERT INTO UserRole (UserId, RoleId) SELECT u.Id, r.Id From Users u left join Roles r on 1=1 where UserName = 'User' and RoleName = N'Default'
|
||||
|
||||
-- 角色菜单关联
|
||||
TRUNCATE Table NavigationRole
|
||||
INSERT INTO NavigationRole (NavigationID, RoleID) SELECT n.Id, r.Id FROM Navigations n left join Roles r on 1=1 Where RoleName = 'Administrators'
|
||||
INSERT INTO NavigationRole (NavigationID, RoleID) SELECT n.Id, r.Id FROM Navigations n left join Roles r on 1=1 where RoleName = 'Default' and Name in ('后台管理', '个人中心', '返回前台', '通知管理')
|
||||
INSERT INTO NavigationRole (NavigationID, RoleID) SELECT n.Id, r.Id FROM Navigations n left join Roles r on 1=1 where RoleName = 'Default' and ParentId in (select Id from Navigations where Name in ('个人中心'))
|
||||
INSERT INTO NavigationRole (NavigationID, RoleID) SELECT n.Id, r.Id FROM Navigations n left join Roles r on 1=1 where RoleName = 'Default' and Name in (N'后台管理', N'个人中心', N'返回前台', N'通知管理')
|
||||
INSERT INTO NavigationRole (NavigationID, RoleID) SELECT n.Id, r.Id FROM Navigations n left join Roles r on 1=1 where RoleName = 'Default' and ParentId in (select Id from Navigations where Name in (N'个人中心'))
|
||||
|
||||
-- Client Data
|
||||
Declare @AppId nvarchar(1)
|
||||
|
|
Loading…
Reference in New Issue