diff --git a/main.go b/main.go index 81a8ea1..025b62f 100644 --- a/main.go +++ b/main.go @@ -155,7 +155,7 @@ func CloneForColumn[T any](db *sql.DB, table, column string, from, to T, omit .. } q := fmt.Sprintf( - `INSERT INTO %q (%q, %s) SELECT $2, %s %s %s FROM %q WHERE %q = $1`, + `INSERT INTO %q (%q, %s) SELECT $1, %s %s %s FROM %q WHERE %q = $2`, table, column, strings.Join(append(incrGenColumns, append(uuidGenColumns, notTheseColumns...)...), ", "), func() string { incrs := make([]string, len(incrGenColumns)) @@ -180,7 +180,7 @@ func CloneForColumn[T any](db *sql.DB, table, column string, from, to T, omit .. return s }(), strings.Join(notTheseColumns, ", "), table, column, ) - log.Printf("EXEC | %s (%v, %v)", q, from, to) + log.Printf("EXEC | %s (%v, %v)", q, to, from) return Insert(db, q, to, from) }