Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
fix: handle onupdate of branch (#13312)
h3n4ld31bf6aea9ea
diff --git a/backend/api/v1/schema_design_merge.go b/backend/api/v1/schema_design_merge.goindex 578054ffda..32a463561f 100644--- a/backend/api/v1/schema_design_merge.go+++ b/backend/api/v1/schema_design_merge.go@@ -711,6 +711,16 @@ func (n *metadataDiffColumnNode) tryMerge(other *metadataDiffColumnNode, engine}}+ if !compareColumnOnUpdateValue(n.head.OnUpdate, other.head.OnUpdate) {+ if !compareColumnOnUpdateValue(n.base.OnUpdate, n.head.OnUpdate) {+ if !compareColumnOnUpdateValue(n.head.OnUpdate, other.head.OnUpdate) {+ return true, fmt.Sprintf("conflict column onUpdate value, one is %+v, the other is %+v", n.head.OnUpdate, other.head.OnUpdate)+ }+ } else {+ n.head.OnUpdate = other.head.OnUpdate+ }+ }+if other.base.Nullable != other.head.Nullable {if n.base.Nullable != n.head.Nullable {if n.head.Nullable != other.head.Nullable {@@ -745,6 +755,16 @@ func (n *metadataDiffColumnNode) tryMerge(other *metadataDiffColumnNode, enginereturn false, ""}+func compareColumnOnUpdateValue(a, b string) bool {+ // TODO(zp): The special case should be assosiacted with the engine type.+ aTimestampDefaultValue := buildTimestampDefaultValue(a)+ bTimestampDefaultValue := buildTimestampDefaultValue(b)+ if aTimestampDefaultValue != nil && bTimestampDefaultValue != nil {+ return aTimestampDefaultValue.getFsp() == bTimestampDefaultValue.getFsp()+ }+ return a == b+}+// To avoid getting caught up in the case struggle, we handle some special cases first.// compareColumnDefaultValue compares the default value of two columns.// The type of a, b should can be assigned to storepb.isColumnMetadata_DefaultValue.