mirror of
https://github.com/bitwarden/server
synced 2026-02-26 09:23:28 +00:00
Purpose: UseMyItems is a new organization ability / plan flag which is automatically enabled where UsePolicies is enabled, but can be selectively disabled to disable My Items creation when the Organization Data Ownership policy is turned on. - new organization table column with all sprocs and views updated - data migration to enable the feature for all organizations that already use policies (replicating existing behaviour) - data and api models updated - added to organization license file so it can be preserved in self-hosted instances - note that we don't have a plan feature defined for this yet, so it is set based on UsePolicies to match the migration logic. Billing Team have a ticket to add this
15 lines
390 B
Transact-SQL
15 lines
390 B
Transact-SQL
-- Enable UseMyItems for all organizations with UsePolicies enabled
|
|
-- Batch to avoid table locks
|
|
DECLARE @BatchSize INT = 1000;
|
|
DECLARE @RowsAffected INT = 1;
|
|
|
|
WHILE @RowsAffected > 0
|
|
BEGIN
|
|
UPDATE TOP (@BatchSize) [dbo].[Organization]
|
|
SET [UseMyItems] = 1
|
|
WHERE [UsePolicies] = 1
|
|
AND [UseMyItems] = 0;
|
|
|
|
SET @RowsAffected = @@ROWCOUNT;
|
|
END
|