DacFx icon indicating copy to clipboard operation
DacFx copied to clipboard

Cannot deploy dacpac with Graph Table that has edges

Open npbenjohnson opened this issue 5 years ago • 0 comments

Steps to reproduce:

  1. Back up a dacpac with DacService.Extract, with ExtractAllTableData = true
  2. 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.

npbenjohnson avatar Dec 11 '20 01:12 npbenjohnson