Skip to content

Database drift #94

@marcingminski

Description

@marcingminski

When upgrading database from version 1.3.3, the deployment fail due to drift:

WARNING: [23:55:05][Publish-DbaDacPackage] Deployment failed | Could not deploy package.
Error SQL0: Database has drifted from its registered data-tier application.

This is because we're doing cleanup operations in the post deploy script which modifies schema. We're dropping some old objects which creates drift from the deployed Dacpac.

I was mistaken, we're not doing any cleanup in 1.3.3 so not sure what causes drift. I will investigate.

This can be solved in the future by one-off manual clean up, however, since SQLWATCH can be deployed into an existing "dba" database, we must allow schema drift otherwise it will never be able to upgrade itself.

A work around is to delete data-tier application.
Right click on the SQLWATCH database in SSMS, Goto Tasks -> Delete Data-Tier Application. Then Delete SQLWATCH registration.

This will NOT delete the database. just DAC entry in msdb.dbo.sysdac_instances. To find out current data-tier applications registration: select * from msdb.dbo.sysdac_instances

image

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