Add sortorder to filesets
This commit is contained in:
parent
24932a63ac
commit
88f226757d
|
@ -113,7 +113,11 @@ sub new {
|
|||
$self->{instances_part_size} = 10_000_000;
|
||||
$self->adjust_partitions;
|
||||
|
||||
$self->{targets} = $self->{dbh}->selectall_arrayref("select * from filesets", { Slice => {} });
|
||||
# Order by ascending sort order with nulls last:
|
||||
# MySQL considers NULL to be smaller than any number, so negate the numbers
|
||||
# (making the largest the smallest) and then sort descending.
|
||||
# Idea from https://www.designcise.com/web/tutorial/how-to-order-null-values-first-or-last-in-mysql
|
||||
$self->{targets} = $self->{dbh}->selectall_arrayref("select * from filesets order by -sortorder desc", { Slice => {} });
|
||||
if ($opt->{filesets}) {
|
||||
$self->{targets} =
|
||||
[
|
||||
|
|
Loading…
Reference in New Issue