-
Notifications
You must be signed in to change notification settings - Fork 24
Description
- SqlPackage or DacFx Version: DacFx 170.2.70
- .NET Framework (Windows-only) or .NET Core: both
- Environment (local platform and source/target platforms): windows 11 with sql 2019 developer
Steps to Reproduce:
-
create sql project and deploy initial database with database audit spec as follows:
-- create server_audit omitted for simplicity
CREATE DATABASE AUDIT SPECIFICATION db_audit_spec
FOR SERVER AUDIT server_audit
ADD (DATABASE_OBJECT_CHANGE_GROUP)
WITH (STATE = ON) -
modify database audit spec object in a project and deploy database
CREATE DATABASE AUDIT SPECIFICATION db_audit_spec
FOR SERVER AUDIT server_audit
ADD (SCHEMA_OBJECT_CHANGE_GROUP)
WITH (STATE = ON)
db_audit_spec will not be modified. audit_action_group_name are ignored by compare logic, thus DATABASE AUDIT SPECIFICATION cannot be changed, you have to drop it in target db first, and create it again, because its only created correctly when there is no object in target db. I checked with STATE ON and OFF, because with STATE ON, object cannot be altered, it made no difference.
when check ComparisonResult it a deployment contributor the change is visible in ElementsChanged and in ElementsComposingChildrenChanged, but definition of AuditActionGroup is empty, there is no step in a deployment plan corresponding with this change also.
My expectation is the following script
- handle state of db_audit_spec if needed
- alter db_audit_spec, add or drop correct audit object groups
- handle state of db_audit_spec if needed
Did this occur in prior versions? If not - which version(s) did it work in?
YES
(DacFx and Visual Studio ssdt compare)