DacFx
DacFx copied to clipboard
Cannot deploy dacpac with Graph Table that has edges
Steps to reproduce:
- Back up a dacpac with DacService.Extract, with ExtractAllTableData = true
- Restore the backup with DacServices.Deploy. Iterations I've tried are:
- Completely dropping the table and then creating it with Deploy
- Using CreateNewDatabase = true in the options object, and specifying upgradeExisting = false param.
- Specify options with DoNotDropObjectTypes = new ObjectType[] { ObjectType.Tables}
Error: {"Could not deploy package.\r\nError SQL72014: Core Microsoft SqlClient Data Provider: Msg 13944, Level 16, State 1, Line 1 Cannot truncate table 'dbo.B2bCustomerNode' because it is being referenced by an EDGE constraint.\r\nError SQL72045: Script execution error. The executed script:\r\nTRUNCATE TABLE [dbo].[B2bCustomerNode];\r\n\r\n\r\n"}
B2bCustomerNode is a Sql Graph Node, and it does have an edge table constraint.