Files
server/util/Migrator/DbScripts/2026-04-29_01_UseInviteLinksDataMigration.sql
Rui Tomé 52d9a9cc88 [PM-35253] Add organization ability UseInviteLinks (#7489)
* 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
2026-04-30 10:13:50 +01:00

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