mirror of
https://github.com/bitwarden/server.git
synced 2026-06-01 01:55:55 -05:00
* Add UseInviteLinks to Organization SQL schema and views * Add Migrator scripts for UseInviteLinks column and data migration * Add EF migrations for UseInviteLinks on Organization * Wire UseInviteLinks through organization domain and repositories * Add HasInviteLinks plan support and UseInviteLinks license handling * Expose UseInviteLinks and HasInviteLinks on organization and plan API models * Update tests for UseInviteLinks and invite-links plan feature * Update migration script with missing update to Organization_ReadManyByIds * Move UseInviteLinks column after ExemptFromBillingAutomation * Bump date on migration scripts
19 lines
673 B
Transact-SQL
19 lines
673 B
Transact-SQL
-- Enable UseInviteLinks for all Enterprise organizations
|
|
-- Enterprise plan types: 4 (EnterpriseMonthly2019), 5 (EnterpriseAnnually2019),
|
|
-- 10 (EnterpriseMonthly2020), 11 (EnterpriseAnnually2020),
|
|
-- 14 (EnterpriseMonthly2023), 15 (EnterpriseAnnually2023),
|
|
-- 19 (EnterpriseMonthly), 20 (EnterpriseAnnually)
|
|
-- Batch to avoid table locks
|
|
DECLARE @BatchSize INT = 1000;
|
|
DECLARE @RowsAffected INT = 1;
|
|
|
|
WHILE @RowsAffected > 0
|
|
BEGIN
|
|
UPDATE TOP (@BatchSize) [dbo].[Organization]
|
|
SET [UseInviteLinks] = 1
|
|
WHERE [PlanType] IN (4, 5, 10, 11, 14, 15, 19, 20)
|
|
AND [UseInviteLinks] = 0;
|
|
|
|
SET @RowsAffected = @@ROWCOUNT;
|
|
END
|