diff --git a/src/Tuitio.Domain.Data/Scripts/2.4.0/01.UserGroup table.sql b/src/Tuitio.Domain.Data/Scripts/2.4.0/01.UserGroup table.sql index 3b63d01..8c078ab 100644 --- a/src/Tuitio.Domain.Data/Scripts/2.4.0/01.UserGroup table.sql +++ b/src/Tuitio.Domain.Data/Scripts/2.4.0/01.UserGroup table.sql @@ -6,14 +6,4 @@ begin UserGroupCode varchar(30) not null, UserGroupName varchar(50) not null ) -end - -if not exists (select top 1 1 from UserGroup) -begin - insert into UserGroup(UserGroupCode, UserGroupName) - values ('ADMINISTRATORS', 'Administrators'), - ('USERS', 'Users'), - ('DEVELOPERS', 'Developers'), - ('VIEWERS', 'Viewers'), - ('GUESTS', 'Guests') end \ No newline at end of file diff --git a/src/Tuitio.Domain.Data/Scripts/2.4.0/02.UserRole table.sql b/src/Tuitio.Domain.Data/Scripts/2.4.0/02.UserRole table.sql index d179656..d34ddaf 100644 --- a/src/Tuitio.Domain.Data/Scripts/2.4.0/02.UserRole table.sql +++ b/src/Tuitio.Domain.Data/Scripts/2.4.0/02.UserRole table.sql @@ -6,17 +6,4 @@ begin UserRoleCode varchar(30) not null, UserRoleName varchar(50) not null ) -end - -if not exists (select top 1 1 from UserRole) -begin - insert into UserRole(UserRoleCode, UserRoleName) - values ('SYSTEM_ADMINISTRATOR', 'System administrator'), - ('FULLSTACK_DEVELOPER', 'Fullstack developer'), - ('POWER_USER', 'Power user'), - ('REGULAR_USER', 'Regular user'), - ('READONLY_USER', 'Readonly user'), - ('ANONYMOUS_USER', 'Anonymous user'), - ('DEMO_USER', 'Demo user') -end - +end \ No newline at end of file diff --git a/src/Tuitio.Domain.Data/Scripts/2.4.0/04.Link user groups and roles.sql b/src/Tuitio.Domain.Data/Scripts/2.4.0/04.Link user groups and roles.sql deleted file mode 100644 index e1a91c8..0000000 --- a/src/Tuitio.Domain.Data/Scripts/2.4.0/04.Link user groups and roles.sql +++ /dev/null @@ -1,58 +0,0 @@ - -declare @admin_group_id int, @admin_role_id int - -select @admin_group_id = UserGroupId from UserGroup where UserGroupCode = 'ADMINISTRATORS' -select @admin_role_id = UserRoleId from UserRole where UserRoleCode = 'SYSTEM_ADMINISTRATOR' - -if not exists (select top 1 1 from UserGroupXUserRole where UserGroupId = @admin_group_id and UserRoleId = @admin_role_id) -begin - insert into UserGroupXUserRole (UserGroupId, UserRoleId) - values (@admin_group_id, @admin_role_id) -end - - -declare @developer_group_id int, @developer_role_id int - -select @developer_group_id = UserGroupId from UserGroup where UserGroupCode = 'DEVELOPERS' -select @developer_role_id = UserRoleId from UserRole where UserRoleCode = 'FULLSTACK_DEVELOPER' - -if not exists (select top 1 1 from UserGroupXUserRole where UserGroupId = @developer_group_id and UserRoleId = @developer_role_id) -begin - insert into UserGroupXUserRole (UserGroupId, UserRoleId) - values (@developer_group_id, @developer_role_id) -end - - -declare @user_group_id int, @user_role_id int - -select @user_group_id = UserGroupId from UserGroup where UserGroupCode = 'USERS' -select @user_role_id = UserRoleId from UserRole where UserRoleCode = 'REGULAR_USER' - -if not exists (select top 1 1 from UserGroupXUserRole where UserGroupId = @user_group_id and UserRoleId = @user_role_id) -begin - insert into UserGroupXUserRole (UserGroupId, UserRoleId) - values (@user_group_id, @user_role_id) -end - - -declare @viewer_group_id int, @viewer_role_id int - -select @viewer_group_id = UserGroupId from UserGroup where UserGroupCode = 'VIEWERS' -select @viewer_role_id = UserRoleId from UserRole where UserRoleCode = 'READONLY_USER' - -if not exists (select top 1 1 from UserGroupXUserRole where UserGroupId = @viewer_group_id and UserRoleId = @viewer_role_id) -begin - insert into UserGroupXUserRole (UserGroupId, UserRoleId) - values (@viewer_group_id, @viewer_role_id) -end - -declare @guest_group_id int, @guest_role_id int - -select @guest_group_id = UserGroupId from UserGroup where UserGroupCode = 'GUESTS' -select @guest_role_id = UserRoleId from UserRole where UserRoleCode = 'ANONYMOUS_USER' - -if not exists (select top 1 1 from UserGroupXUserRole where UserGroupId = @guest_group_id and UserRoleId = @guest_role_id) -begin - insert into UserGroupXUserRole (UserGroupId, UserRoleId) - values (@guest_group_id, @guest_role_id) -end \ No newline at end of file diff --git a/src/Tuitio.Domain.Data/Tuitio.Domain.Data.csproj b/src/Tuitio.Domain.Data/Tuitio.Domain.Data.csproj index 48067a6..cb073f1 100644 --- a/src/Tuitio.Domain.Data/Tuitio.Domain.Data.csproj +++ b/src/Tuitio.Domain.Data/Tuitio.Domain.Data.csproj @@ -43,9 +43,6 @@ PreserveNewest - - PreserveNewest -