Skip to content
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.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using DoNotDropObjectTypes argument, sqlpackage ignores DropIndexesNotInSource=false #403

Open
GingerSnap-xx opened this issue Jun 17, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@GingerSnap-xx
Copy link

We use azure sql tuning advisor to apply indexes it sees as beneficial. As such our db structure in our solution isn't always in sync with what's in the target schema.

We attempted to use the "DropIndexesNotInSource" argument set to false to prevent the azure generated indexes from being dropped before we have a time to analyze them and internalize them into our solution.

Based on the documentation we've found, it does not seem like indexes is an accepted value for passing to the "DoNotDropObjectTypes" argument.
Arg list
/Action:Publish `
/SourceFile:$dacpacPath `
/TargetConnectionString:$connString `
/V:Configuration=$publishConfig `
/p:BlockOnPossibleDataLoss=false `
/p:NoAlterStatementsToChangeCLRTypes=true `
/p:DeployDatabaseInSingleUserMode=false `
/p:IncludeTransactionalScripts=$includeTransactionalScripts`
/p:CreateNewDatabase=false `
/p:BackupDatabaseBeforeChanges=false `
/p:DropObjectsNotInSource=true `
/P:DropIndexesNotInSource=false `
/p:ScriptDatabaseCompatibility=true `
/p:ScriptDatabaseOptions=true `
/p:IgnoreFileAndLogFilePath=true `
/p:IgnoreFillFactor=true `
/p:IgnoreUserSettingsObjects=true `
/p:AllowIncompatiblePlatform=true `
/p:DoNotDropObjectTypes=$objectTypesToKeep `
/p:IgnoreColumnOrder=true `
/p:CommandTimeout=1200

But what we end up seeing is the indexes being dropped anyway:

2020-06-15T05:00:48.7683713Z Dropping [account].[AccountHolder].[nci_wi_AccountHolder_B9027D8081748BB108F9F00BEB10DE87]...
2020-06-15T05:00:48.7984403Z Dropping [account].[Ledger].[nci_wi_Ledger_428E9D816F0FE79354607E484490B20A]...
2020-06-15T05:00:48.8257682Z Dropping [account].[Ledger].[nci_wi_Ledger_6D80D088BFFD5AE25F144BABD15B1A40]...
2020-06-15T05:00:48.8526572Z Dropping [account].[Ledger].[nci_wi_Ledger_6E25B19DFA6E3BB8967B5726B270DB17]...
2020-06-15T05:00:48.8791748Z Dropping [account].[Note].[nci_wi_Note_8B5E0B53408FB1FB6F82EF7A7EA270FE]...
2020-06-15T05:00:48.9059037Z Dropping [claim].[ClaimHistory].[nci_wi_ClaimHistory_CF1A71F321501BAD2004E62F3192F48F]...
2020-06-15T05:00:48.9322502Z Dropping [class].[VINMaster].[nci_wi_VINMaster_D3AFEE5A69AD073E60392DDEE8BDE6BC]...
2020-06-15T05:00:48.9589680Z Dropping [contract].[Contract].[nci_wi_Contract_50476B2C852EE5C7E3B3E7CF2EB6AB98]...
2020-06-15T05:00:48.9856878Z Dropping [contract].[Contract].[nci_wi_Contract_7E4E65F5E25E6513116DEB3EFCC250AA]...
2020-06-15T05:00:49.0124444Z Dropping [contract].[Contract].[nci_wi_Contract_8C185D570D064D556F7182700139EB3F]...
2020-06-15T05:00:49.0387907Z Dropping [contract].[Contract].[nci_wi_Contract_901FCDCDD84F918D585710F2AA5C827B]...
2020-06-15T05:00:49.0670467Z Dropping [contract].[ContractDisbursement].[nci_wi_ContractDisbursement_D5625CDF24A25C52627E9CCAFDCF12C9]...
2020-06-15T05:00:49.0933761Z Dropping [contract].[HoldDisbursement].[nci_wi_HoldDisbursement_5BA3E741687E9D908ED219534ADAD32B]...
2020-06-15T05:00:49.1188825Z Dropping [contract].[HoldDisbursement].[nci_wi_HoldDisbursement_707969C363B517A7E0D9E28839640333]...
@ErikEJ
Copy link
Contributor

ErikEJ commented Jun 17, 2020

I think your DropObjectsNotInSource option overrides the other one.

@GingerSnap-xx
Copy link
Author

@ErikEJ It might, but then it would be nice if indexes were an allowed value in the do not drop object types argument. Those seem to play nice together.

@dzsquared dzsquared transferred this issue from microsoft/DACExtensions Feb 9, 2024
@dzsquared dzsquared added the bug Something isn't working label Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants