Closed tswelsh closed 2 months ago
Just to add, I pretty much stopped at the first error it ran into - there could be other things referencing types that the script wants to drop.
@SergeyGaluzo - is this something you can help look into?
@EXPEkesheth I will take a look.
Fixed by https://github.com/microsoft/fhir-server/pull/3830 Please re-test.
This isn't fully fixed - the type is also still in use by dbo.BulkReindexResources. Removing that procedure as well (which doesn't appear in the latest schema I don't think) appears to fix the issue, according to my test outlined earlier.
Added drop of this stored procedure in this PR https://github.com/microsoft/fhir-server/pull/3833
Fixed by https://github.com/microsoft/fhir-server/pull/3833. Please re-test.
Thanks @SergeyGaluzo, this looks to be fixed now.
@tswelsh Thanks for your patience.
Describe the bug When running the SQL Server migration scripts, 77.diff.sql attempts to drop a number of "unused" user defined types. For an old enough starting schema, this tries to drop at least one type that is still in use. Specifically, there was an error dropping dbo.BulkCompartmentAssignmentTableType_1, which is in use by the procedure dbo.ReindexResource. This procedure is not dropped first in any migration script.
FHIR Version? Stu3
Data provider? SQL Server
To Reproduce Steps to reproduce the behavior:
Expected behavior All schema migration scripts should complete without error.
Actual behavior On executing 77.diff.sql, SQL Server returns an error:
"Cannot drop type 'dbo.BulkCompartmentAssignmentTableType_1' because it is being referenced by object 'ReindexResource'. There may be other objects that reference this type."
AB#119628