You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SchemaComparison.Compare and SchemaComparisonResult.PublishChangesToProject ignores DropDmlTriggersNotInSource and SchemaDifference.Included property
#595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
DacFx Version: 162.1.172, 162.2.111, 162.3.566, 162.4.92, 162.5.57 as well as 170.0.76-preview
.NET Framework 4.8
Environment (local platform and source/target platforms): WIndows 11
Steps to Reproduce:
Lets assume we have the following
We have database schema in our initial dacpac as follows
CREATE TABLE [dbo].[Table1] (
Id INTNOT NULL,
Col1 nvarchar(50)
)
GO
CREATE TRIGGER [dbo].[Trigger1]
ON [dbo].[Table1]
AFTER INSERT
AS PRINT 'Inserted';
GO
this results in Trigger1 being removed from the project.
From what I can see calling Include and Exclude method works only for top level objects, not second level like triggers.
I've checked this in DeploymentPlanModifier I added to this SchemaComparison.Oprions and drop trigger is present in DeploymentPlanContributorContext.ComparisonResult.ElementsToDrop but there is no operation in DeploymentPlanContributorContext.PlanHandle, I though I could fix it by removing DeploymentStep with this drop, from the plan.
I've also tried to add this trigger to SchemaComparison.ExcludedTargetObjects instance property it did not make any difference.
SchemaComparison in this example uses dacpac as source, because I have tests that build a package from those scripts above before Compare.
Clicking Exclude on trigger works in VS 2022 17.13.5 UI, trigger will not be deleted from the project. I'm 95% sure VS does not use DacFx internally for schema comparison and updating the project (I think this is the class Microsoft.Data.Tools.Schema.SchemaModel.ModelComparisonResult that corresponds to Microsoft.SqlServer.Dac.SchemaComparisonResult I'm using), its difficult to be sure when I was analyzing VS code in ilspy sadly I'm not the MS employee :)
I want to automate synchronization of a database in my project by ignoring some objects that I know I have to deal with later. but I dont want to do it manually every time I sync it, because database development is ongoing and we have too many objects to click through in UI.
Did this occur in prior versions? I dont think so 162.0.52 is not compatible with my project I would have to change few things
The text was updated successfully, but these errors were encountered:
Tested on:
Steps to Reproduce:
Lets assume we have the following
we are updating the project with it using
this results in Trigger1 being removed from the project.
3. we update the the project using following
this results in
Trigger1
being removed from the project.From what I can see calling Include and Exclude method works only for top level objects, not second level like triggers.
I've checked this in
DeploymentPlanModifier
I added to thisSchemaComparison.Oprions
and drop trigger is present inDeploymentPlanContributorContext.ComparisonResult.ElementsToDrop
but there is no operation inDeploymentPlanContributorContext.PlanHandle
, I though I could fix it by removingDeploymentStep
with this drop, from the plan.I've also tried to add this trigger to
SchemaComparison.ExcludedTargetObjects
instance property it did not make any difference.SchemaComparison
in this example uses dacpac as source, because I have tests that build a package from those scripts above before Compare.Clicking Exclude on trigger works in VS 2022 17.13.5 UI, trigger will not be deleted from the project. I'm 95% sure VS does not use
DacFx
internally for schema comparison and updating the project (I think this is the classMicrosoft.Data.Tools.Schema.SchemaModel.ModelComparisonResult
that corresponds toMicrosoft.SqlServer.Dac.SchemaComparisonResult
I'm using), its difficult to be sure when I was analyzing VS code in ilspy sadly I'm not the MS employee :)I want to automate synchronization of a database in my project by ignoring some objects that I know I have to deal with later. but I dont want to do it manually every time I sync it, because database development is ongoing and we have too many objects to click through in UI.
Did this occur in prior versions? I dont think so 162.0.52 is not compatible with my project I would have to change few things
The text was updated successfully, but these errors were encountered: