Skip to content

Commit

Permalink
Order layer outputs in the order they were added (#1399)
Browse files Browse the repository at this point in the history
Summarize your change.
When adding multiple outputs to a layer, they are not returned in the same order as they were added.
This adds a new SERIAL column which auto-increments to the layer_output table.

With the correct order, it's possible to determine the "main" output of a layer by using the order.
  • Loading branch information
lithorus authored Jul 10, 2024
1 parent ad89c30 commit 15c8d48
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.29
0.30
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ public void insertLayerOutput(LayerInterface layer, String filespec) {
"FROM " +
"layer_output " +
"WHERE " +
"pk_layer = ?";
"pk_layer = ?" +
"ORDER BY " +
"ser_order";

private static final RowMapper<String> OUTPUT_MAPPER =
new RowMapper<String>() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- Add a serial column to layer_output for getting correct order of outputs

alter table layer_output add ser_order SERIAL not null;

0 comments on commit 15c8d48

Please sign in to comment.