Skip to content

Index touched and dropped not in SSDT Project when new column added to same table in project #47

@taylormadesoft

Description

@taylormadesoft

Versions 1.5.3 and 1.5.2 failed.

SQL SERVER 2019

VS 2022 64-bit LTSC 17.8

Steps to Reproduce:

  1. Create index in SSMS on SQL Server outside of Visual Studio SSDT Database project, e.g.:

CREATE INDEX idx_MyNewIndex

ON dbo.MYTESTTABLE(Field1, Field2);

  1. Add new column to SSDT Database Project to SAME TABLE TO WHICH THE INDEX IS ON in VS. e.g. [MY_NEW_FIELD] NCHAR(10) NULL,

  2. MS Build the Database project.

  3. Deploy built DACPAC via the following command:

sqlpackage.exe /Action:Publish `

/SourceFile:".....\xxx.dacpac" `

/TargetConnectionString:"Data Source=xxxx;Integrated Security=True;Initial Catalog=xxx;TrustServerCertificate=True;" `

/p:AdditionalDeploymentContributors=AgileSqlClub.DeploymentFilterContributor `

/p:AdditionalDeploymentContributorPaths="xxx" `

/p:AdditionalDeploymentContributorArguments="SqlPackageFilter=IgnoreSchema(^((?!\bdbo\b).)*$)" `

/p:DropObjectsNotInSource=false `

/p:BlockOnPossibleDataLoss=false `

/p:IgnoreTableOptions=false `

/Diagnostics > "xxxx\sqlpackage_output.txt" 2>&1
  1. EXPECTED RESULTS: 1) New column added and 2) Index not in project untouched and still there that is never dropped and recreated and never dropped at all or touched at all by DACPAC SQL.

  2. ACTUAL RESULTS: 1) New column only created, 2) Index dropped.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions