diff --git a/pkg/resource/common.go b/pkg/resource/common.go index c9fc134b..0e4db44f 100644 --- a/pkg/resource/common.go +++ b/pkg/resource/common.go @@ -122,6 +122,7 @@ func filterFunctionBySchema(input []objects.Function, allowedSchema ...string) ( t := input[i] if _, exist := mapSchema[t.Schema]; exist { + ImportLogger.Debug("spFunction", "append", t) output = append(output, t) } } diff --git a/pkg/resource/rpc/compare.go b/pkg/resource/rpc/compare.go index 9f0cc919..e6896f3e 100644 --- a/pkg/resource/rpc/compare.go +++ b/pkg/resource/rpc/compare.go @@ -27,10 +27,13 @@ func CompareList(sourceFn []objects.Function, targetFn []objects.Function) (diff for i := range targetFn { f := targetFn[i] mapTargetFn[f.Name] = f + Logger.Debug("TargetFn", "target-name", f) } for i := range sourceFn { s := sourceFn[i] + s.CompleteStatement = strings.ReplaceAll(s.CompleteStatement, "search_path TO", "search_path =") + Logger.Debug("SourceFn", "source-name", s) t, isExist := mapTargetFn[s.Name] if !isExist { diff --git a/pkg/resource/tables/compare.go b/pkg/resource/tables/compare.go index 95aa9b4a..6a864875 100644 --- a/pkg/resource/tables/compare.go +++ b/pkg/resource/tables/compare.go @@ -103,6 +103,9 @@ func CompareItem(source, target objects.Table) (diffResult CompareDiffResult) { if len(updateItem.ChangeItems) == 0 && len(updateItem.ChangeColumnItems) == 0 && len(updateItem.ChangeRelationItems) == 0 { diffResult.IsConflict = false } else { + Logger.Debug("changeItems", "conflict-check", updateItem.ChangeItems) + Logger.Debug("changeColumnItems", "conflict-check", updateItem.ChangeColumnItems) + Logger.Debug("changeRelationItems", "conflict-check", updateItem.ChangeRelationItems) diffResult.IsConflict = true } @@ -222,7 +225,7 @@ func compareRelations(table *objects.Table, source, target []objects.TablesRelat } if !strings.HasPrefix(sc.ConstraintName, fmt.Sprintf("%s_", sc.SourceSchema)) { - Logger.Info("constrain name update", "from", sc.ConstraintName, "to", fmt.Sprintf("%s_%s", sc.SourceSchema, sc.ConstraintName)) + Logger.Debug("constrain name update", "from", sc.ConstraintName, "to", fmt.Sprintf("%s_%s", sc.SourceSchema, sc.ConstraintName)) sc.ConstraintName = fmt.Sprintf("%s_%s", sc.SourceSchema, sc.ConstraintName) } diff --git a/rpc.go b/rpc.go index ae5e13e8..cb5aa7ce 100644 --- a/rpc.go +++ b/rpc.go @@ -492,7 +492,7 @@ func (r *RpcBase) SetCompleteStmt(stmt string) { } func (r *RpcBase) GetCompleteStmt() string { - return r.CompleteStatement + return strings.ReplaceAll(r.CompleteStatement, "search_path to ", "search_path = ") } // ----- Rpc Param Functionality -----