Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore(branch): using head of merge to as ancestor (#10545)

h3n4l3fe885859ebb
diff --git a/backend/api/v1/branch_service.go b/backend/api/v1/branch_service.go
index 19079a067a..d25a4455a9 100644
--- a/backend/api/v1/branch_service.go
+++ b/backend/api/v1/branch_service.go
@@ -416,7 +416,7 @@ func (s *BranchService) MergeBranch(ctx context.Context, request *v1pb.MergeBran
// Restrict merging only when the head branch is not updated.
// Maybe we can support auto-merging in the future.
- mergedMetadata, err := tryMerge(headBranch.Base.Metadata, headBranch.Head.Metadata, baseBranch.Head.Metadata)
+ mergedMetadata, err := tryMerge(baseBranch.Head.Metadata, headBranch.Head.Metadata, headBranch.Base.Metadata)
if err != nil {
slog.Info("cannot merge branches", log.BBError(err))
return nil, status.Errorf(codes.Aborted, "cannot merge branches without conflict, error: %v", err)
diff --git a/backend/api/v1/schema_design_merge.go b/backend/api/v1/schema_design_merge.go
index 592b9690f8..fa01c2cf48 100644
--- a/backend/api/v1/schema_design_merge.go
+++ b/backend/api/v1/schema_design_merge.go
@@ -503,8 +503,8 @@ func (n *metadataDiffColumnNode) tryMerge(other *metadataDiffColumnNode) (bool,
if n.head.Type != other.head.Type {
return true, fmt.Sprintf("conflict column type, one is %s, the other is %s", n.head.Type, other.head.Type)
}
- if n.head.DefaultValue != other.head.DefaultValue {
- return true, fmt.Sprintf("conflict column default value, one is %s, the other is %s", n.head.DefaultValue, other.head.DefaultValue)
+ if cmp.Diff(n.head.DefaultValue, other.head.DefaultValue, protocmp.Transform()) != "" {
+ return true, fmt.Sprintf("conflict column default value, one is %v, the other is %v", n.head.DefaultValue, other.head.DefaultValue)
}
if n.head.Nullable != other.head.Nullable {
return true, fmt.Sprintf("conflict column nullable, one is %t, the other is %t", n.head.Nullable, other.head.Nullable)