Skip to content

Commit

Permalink
Fixing Migration Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhinJ committed Jul 29, 2023
1 parent 16ad019 commit c879693
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
37 changes: 37 additions & 0 deletions doc/src/migration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,43 @@ Migration of functions that add new columns
.. contents:: Contents
:local:

Migration of ``pgr_withPointsKSP``
-------------------------------------------------------------------------------

Starting from `v3.6.0 <https://docs.pgrouting.org/3.6/en/migration.html>`__

Signatures to be migrated:

* ``pgr_withPointsKSP`` (`One to One`)

:Before Migration:

* Output columns were |old-pid-result|

* Depending on the overload used, the columns ``start_vid`` and ``end_vid``
might be missing:

* ``pgr_withPointsKSP`` (`One to One`) does not have ``start_vid`` and ``end_vid``.

:Migration:

* Be aware of the existance of the additional columns.

* In ``pgr_withPointsKSP`` (`One to One`)

* ``start_vid`` contains the **start vid** parameter value.
* ``end_vid`` contains the **end vid** parameter value.

.. literalinclude:: migration.queries
:start-after: --withPointsKSP1
:end-before: --withPointsKSP1

* If needed filter out the added columns, for example:

.. literalinclude:: migration.queries
:start-after: --astar4
:end-before: --astar5

Migration of ``pgr_aStar``
-------------------------------------------------------------------------------

Expand Down
15 changes: 15 additions & 0 deletions docqueries/src/migration.result
Original file line number Diff line number Diff line change
Expand Up @@ -719,5 +719,20 @@ SELECT seq, path_seq, node, edge, cost, agg_cost FROM pgr_aStar(
(6 rows)

/* --astar5 */
/* --withPointsKSP1 */
SELECT * FROM pgr_aStar(
$$SELECT id, source, target, cost, reverse_cost, x1, y1, x2, y2 FROM edges$$,
6, 10);
seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost
-----+----------+-----------+---------+------+------+------+----------
1 | 1 | 6 | 10 | 6 | 4 | 1 | 0
2 | 2 | 6 | 10 | 7 | 8 | 1 | 1
3 | 3 | 6 | 10 | 11 | 9 | 1 | 2
4 | 4 | 6 | 10 | 16 | 16 | 1 | 3
5 | 5 | 6 | 10 | 15 | 3 | 1 | 4
6 | 6 | 6 | 10 | 10 | -1 | 0 | 5
(6 rows)

/* --withPointsKSP1 */
ROLLBACK;
ROLLBACK
5 changes: 5 additions & 0 deletions docqueries/src/migration.test.sql
Original file line number Diff line number Diff line change
Expand Up @@ -244,3 +244,8 @@ SELECT seq, path_seq, node, edge, cost, agg_cost FROM pgr_aStar(
$$SELECT id, source, target, cost, reverse_cost, x1, y1, x2, y2 FROM edges$$,
6, 10);
/* --astar5 */
/* --withPointsKSP1 */
SELECT * FROM pgr_withPointsKSP(
$$SELECT * FROM edges$$,
6, 10);
/* --withPointsKSP1 */

0 comments on commit c879693

Please sign in to comment.