Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PM-10365] Drop OrganizationUser AccessAll #4701

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
110f39b
Remove OrganizationUser.AccessAll
eliykat Aug 27, 2024
67db348
Remove from EF
eliykat Aug 27, 2024
0aab267
EF migrations
eliykat Sep 2, 2024
94a400a
Split SQL migration
eliykat Sep 2, 2024
2ff86bb
Add additional check for if column exists
eliykat Sep 2, 2024
5ba85f8
Drop default constraint
eliykat Sep 2, 2024
de9548f
Merge branch 'main' into ac/pm-10365/remove-organizationuser-accessalโ€ฆ
eliykat Sep 5, 2024
2c7c763
Merge branch 'main' into ac/pm-10365/remove-organizationuser-accessalโ€ฆ
eliykat Sep 6, 2024
ad31075
Merge branch 'main' into ac/pm-10365/remove-organizationuser-accessalโ€ฆ
eliykat Sep 9, 2024
dc167a8
Merge branch 'main' into ac/pm-10365/remove-organizationuser-accessalโ€ฆ
eliykat Sep 9, 2024
76c07d7
Merge branch 'main' into ac/pm-10365/remove-organizationuser-accessalโ€ฆ
eliykat Sep 13, 2024
e93b347
Bump mssql migrations
eliykat Sep 13, 2024
0a9ba1a
Drop migrations
eliykat Sep 13, 2024
69f10e8
revert snapshots
eliykat Sep 13, 2024
93bbc0b
Re-run ef migrations
eliykat Sep 13, 2024
67d3004
dotnet format
eliykat Sep 13, 2024
8b48476
Merge branch 'main' into ac/pm-10365/remove-organizationuser-accessalโ€ฆ
eliykat Sep 15, 2024
ae67beb
Merge remote-tracking branch 'origin/main' into ac/pm-10365/remove-orโ€ฆ
eliykat Sep 24, 2024
22b9762
Update mssql migration dates
eliykat Sep 24, 2024
2728263
Revert EF migrations
eliykat Sep 24, 2024
85f78b1
Regenerate EF migrations
eliykat Sep 24, 2024
d4f1ec1
dotnet format
eliykat Sep 24, 2024
576be63
Create new index before we drop the old one
eliykat Sep 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,7 @@ protected override void OnModelCreating(ModelBuilder builder)
var eOrganizationDomain = builder.Entity<OrganizationDomain>();
var aWebAuthnCredential = builder.Entity<WebAuthnCredential>();

// Shadow property configurations
builder.Entity<OrganizationUser>()
.Property<bool>("AccessAll")
.HasDefaultValue(false);
// Shadow property configurations go here

eCipher.Property(c => c.Id).ValueGeneratedNever();
eCollection.Property(c => c.Id).ValueGeneratedNever();
Expand Down
3 changes: 0 additions & 3 deletions src/Sql/dbo/Stored Procedures/OrganizationUser_Create.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
@Key VARCHAR(MAX),
@Status SMALLINT,
@Type TINYINT,
@AccessAll BIT = 0,
@ExternalId NVARCHAR(300),
@CreationDate DATETIME2(7),
@RevisionDate DATETIME2(7),
Expand All @@ -26,7 +25,6 @@ BEGIN
[Key],
[Status],
[Type],
[AccessAll],
[ExternalId],
[CreationDate],
[RevisionDate],
Expand All @@ -43,7 +41,6 @@ BEGIN
@Key,
@Status,
@Type,
@AccessAll,
@ExternalId,
@CreationDate,
@RevisionDate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ BEGIN
[Key],
[Status],
[Type],
[AccessAll],
[ExternalId],
[CreationDate],
[RevisionDate],
Expand All @@ -29,7 +28,6 @@ BEGIN
OUI.[Key],
OUI.[Status],
OUI.[Type],
0, -- AccessAll will be removed shortly
OUI.[ExternalId],
OUI.[CreationDate],
OUI.[RevisionDate],
Expand Down
42 changes: 0 additions & 42 deletions src/Sql/dbo/Stored Procedures/OrganizationUser_CreateMany2.sql

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ CREATE PROCEDURE [dbo].[OrganizationUser_CreateWithCollections]
@Key VARCHAR(MAX),
@Status SMALLINT,
@Type TINYINT,
@AccessAll BIT = 0,
@ExternalId NVARCHAR(300),
@CreationDate DATETIME2(7),
@RevisionDate DATETIME2(7),
Expand All @@ -18,7 +17,7 @@ AS
BEGIN
SET NOCOUNT ON

EXEC [dbo].[OrganizationUser_Create] @Id, @OrganizationId, @UserId, @Email, @Key, @Status, @Type, @AccessAll, @ExternalId, @CreationDate, @RevisionDate, @Permissions, @ResetPasswordKey, @AccessSecretsManager
EXEC [dbo].[OrganizationUser_Create] @Id, @OrganizationId, @UserId, @Email, @Key, @Status, @Type, @ExternalId, @CreationDate, @RevisionDate, @Permissions, @ResetPasswordKey, @AccessSecretsManager

;WITH [AvailableCollectionsCTE] AS(
SELECT
Expand Down
2 changes: 0 additions & 2 deletions src/Sql/dbo/Stored Procedures/OrganizationUser_Update.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
@Key VARCHAR(MAX),
@Status SMALLINT,
@Type TINYINT,
@AccessAll BIT = 0,
@ExternalId NVARCHAR(300),
@CreationDate DATETIME2(7),
@RevisionDate DATETIME2(7),
Expand All @@ -26,7 +25,6 @@ BEGIN
[Key] = @Key,
[Status] = @Status,
[Type] = @Type,
[AccessAll] = @AccessAll,
[ExternalId] = @ExternalId,
[CreationDate] = @CreationDate,
[RevisionDate] = @RevisionDate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ BEGIN
[Key] = OUI.[Key],
[Status] = OUI.[Status],
[Type] = OUI.[Type],
[AccessAll] = 0, -- AccessAll will be removed shortly
[ExternalId] = OUI.[ExternalId],
[CreationDate] = OUI.[CreationDate],
[RevisionDate] = OUI.[RevisionDate],
Expand Down
34 changes: 0 additions & 34 deletions src/Sql/dbo/Stored Procedures/OrganizationUser_UpdateMany2.sql

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
@Key VARCHAR(MAX),
@Status SMALLINT,
@Type TINYINT,
@AccessAll BIT = 0,
@ExternalId NVARCHAR(300),
@CreationDate DATETIME2(7),
@RevisionDate DATETIME2(7),
Expand All @@ -18,7 +17,7 @@ AS
BEGIN
SET NOCOUNT ON

EXEC [dbo].[OrganizationUser_Update] @Id, @OrganizationId, @UserId, @Email, @Key, @Status, @Type, @AccessAll, @ExternalId, @CreationDate, @RevisionDate, @Permissions, @ResetPasswordKey, @AccessSecretsManager
EXEC [dbo].[OrganizationUser_Update] @Id, @OrganizationId, @UserId, @Email, @Key, @Status, @Type, @ExternalId, @CreationDate, @RevisionDate, @Permissions, @ResetPasswordKey, @AccessSecretsManager
-- Update
UPDATE
[Target]
Expand Down
6 changes: 2 additions & 4 deletions src/Sql/dbo/Tables/OrganizationUser.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
[ResetPasswordKey] VARCHAR (MAX) NULL,
[Status] SMALLINT NOT NULL,
[Type] TINYINT NOT NULL,
[AccessAll] BIT NOT NULL,
[ExternalId] NVARCHAR (300) NULL,
[CreationDate] DATETIME2 (7) NOT NULL,
[RevisionDate] DATETIME2 (7) NOT NULL,
Expand All @@ -20,9 +19,8 @@


GO
CREATE NONCLUSTERED INDEX [IX_OrganizationUser_UserIdOrganizationIdStatus]
ON [dbo].[OrganizationUser]([UserId] ASC, [OrganizationId] ASC, [Status] ASC)
INCLUDE ([AccessAll]);
CREATE NONCLUSTERED INDEX [IX_OrganizationUser_UserIdOrganizationIdStatusV2]
ON [dbo].[OrganizationUser]([UserId] ASC, [OrganizationId] ASC, [Status] ASC);


GO
Expand Down
16 changes: 0 additions & 16 deletions src/Sql/dbo/User Defined Types/OrganizationUserType2.sql

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- Finalise removal of OrganizationUser.AccessAll column
-- Add default column value
-- Sprocs already have default value for rollback purposes, this just supports dropping the column itself

IF OBJECT_ID('[dbo].[DF_OrganizationUser_AccessAll]', 'D') IS NULL
AND COL_LENGTH('[dbo].[OrganizationUser]', 'AccessAll') IS NOT NULL
BEGIN
ALTER TABLE [dbo].[OrganizationUser]
ADD CONSTRAINT [DF_OrganizationUser_AccessAll] DEFAULT (0) FOR [AccessAll];
END
GO
Loading
Loading