-- ============================================================================= -- Entitlement Platform — ProvisioningJob SqlWorkbench linkage (SQL Server variant) -- Migration: 20260805 — Client Onboarding Orchestrator -- -- Adds the two columns ClientOnboardingOrchestratorBLL needs to track a client's -- in-flight SqlWorkbench ClientProvisioning ChangeRequest across the async gap between -- "CR submitted, awaiting approval" and "CR Executed" (the Dapr event on -- "sqlworkbench.changerequest.executed" that resumes the rest of onboarding). Both -- nullable — a job with neither set has not reached the DB-provisioning step yet. -- ============================================================================= IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id = OBJECT_ID('MPROVISIONINGJOB') AND name = 'SWCHANGEREQUESTID') BEGIN ALTER TABLE MPROVISIONINGJOB ADD SWCHANGEREQUESTID INT NULL, -- SW.MSWCHANGEREQUEST.CHANGEREQUESTID (different DB/ID space — FK-by-convention only) SWCLIENTDATABASEID INT NULL; -- SW.MSWCLIENTDATABASE.CLIENTDBID (different DB/ID space — FK-by-convention only) END GO